Linux的常用命令

查看硬盘使用了多少容量

[root@iZ2ze32 ~]# df -hl
文件系统        容量  已用  可用 已用% 挂载点
/dev/vda1        40G  3.7G   34G   10% /
devtmpfs        1.9G     0  1.9G    0% /dev
tmpfs           1.9G     0  1.9G    0% /dev/shm
tmpfs           1.9G  364K  1.9G    1% /run
tmpfs           1.9G     0  1.9G    0% /sys/fs/cgroup
tmpfs           380M     0  380M    0% /run/user/0


[root@iZ2ze326 ~]# df
文件系统          1K-块    已用     可用 已用% 挂载点
/dev/vda1      41151808 3867112 35171264   10% /
devtmpfs        1931336       0  1931336    0% /dev
tmpfs           1940844       0  1940844    0% /dev/shm
tmpfs           1940844     364  1940480    1% /run
tmpfs           1940844       0  1940844    0% /sys/fs/cgroup
tmpfs            388172       0   388172    0% /run/user/0

查看Linux系统是Centos还是Ubuntu

输入命令 lsb_release -a

## 现在有的系统可以用这个查出是否是centos还是ubuntu,如阿里云
[root@iZ2ze326 ~]# lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.4.1708 (Core)
Release:    7.4.1708
Codename:   Core

## 而在公司的本地服务器,却出现这种情况
[root@hardwareupdate ~]# lsb_release -a
-bash: lsb_release: command not found

当这个命令不管用的时候,可以使用命令 cat /etc/redhat-release

## 在ubuntu中会出现
[root@hardwareupdate ~]# cat /etc/redhat-release
-bash: /etc/redhat-release: command not found

## 在centos中显示
[root@hardwareupdate ~]# cat /etc/redhat-release
CentOS release 6.10 (Final)

查看Linux 某些程序进程 ps aux

比如:

[root@iZ2ze3269b etc]# ps aux | grep mysql
root      2371  0.0  0.0 112676   980 pts/0    S+   14:34   0:00 grep --color=auto mysql
mysql    10810  0.1  9.4 1599384 367788 ?      Sl   10月11  13:13 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

持续更新中。。。。。。

你可能感兴趣的:(Linux的常用命令)