1. Check the disk space: df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 40G 4.5G 33G 12% /
tmpfs 498M 0 498M 0% /dev/shm
-h GB MB KB in human-readable format
If df -h /etc will automatically analyze the disk capacity of the partition where the directory is located
2. Check the size of the directory: du -sh
[root@newj server]# du -s *|sort -nr 371644 bk 304964 jdk1.7.0_80 173240 node 125732 tomcat7.0.73 39904 ghost 10292 svn 2160 flask0.10 4 hello.py 4 apps
-s summary Summarize space size
-h human readable format GB MB KB
Sorting in descending order of occupied space is |sort -nr
sort -n sort numerically ; -r reverse order
du -hs * --> * indicates the respective summary of all files in the directory , not the overall summary, but the summary separately.
3. Top dynamically view the process (relative to ps) and the CPU, MEM , etc.
Press q to leave.
-d is followed by the update time in seconds, the default is 5 seconds
In the process of updating the status: PMN will be displayed in reverse order according to the CPU, MEM memory usage, and the size of the process number.
[root@niewj server]# top -d20 top - 17:56:26 up 124 days, 2:49, 1 user, load average: 0.35, 0.15, 0.08 Tasks: 75 total, 1 running, 74 sleeping, 0 stopped, 0 zombie Cpu (s): 0.2%us, 0.1%sy, 0.0%ni, 99.6%id, 0.0%wa, 0.0%hi, 0.0%si, 0.1%st Mem: 1018508k total, 900120k used, 118388k free, 187012k buffers Swap: 0k total, 0k used, 0k free, 327424k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 20 0 19232 828 536 S 0.0 0.1 0:03.18 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.24 kthreadd 3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 4 root 20 0 0 0 0 S 0.0 0.0 0:18.67 ksoftirqd/0 5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 stopper/0 6 root RT 0 0 0 0 S 0.0 0.0 0:11.98 watchdog/0 7 root 20 0 0 0 0 S 0.0 0.0 9:00.49 events/0 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events/0 9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events_long/0 10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events_power_ef 11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup 12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper 13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns 14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr 15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm
For example, after pressing P:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7313 root 20 0 286m 8948 3248 S 0.3 0.9 392:16.48 AliHids
1 root 20 0 19232 828 536 S 0.0 0.1 0:03.18 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.24 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
4 root 20 0 0 0 0 S 0.0 0.0 0:18.67 ksoftirqd/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 stopper/0
6 root RT 0 0 0 0 S 0.0 0.0 0:11.98 watchdog/0
7 root 20 0 0 0 0 S 0.0 0.0 9:00.51 events/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events/0
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events_long/0
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events_power_ef
11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper
13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns
14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr
For example, after pressing M:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6579 root 20 0 1011m 128m 5732 S 0.0 12.9 83:01.51 node /var/www/g
9016 root 20 0 704m 64m 4852 S 0.0 6.5 37:30.25 PM2 v2.2.1: God
5428 mysql 20 0 694m 35m 2876 S 0.0 3.6 35:29.57 mysqld
7313 root 20 0 286m 8948 3248 S 1.2 0.9 392:16.64 AliHids
881 root 20 0 67324 5576 2332 S 0.0 0.5 367: 31.36 AliYunDun
10511 root 20 0 243m 4864 868 S 0.0 0.5 0:11.77 rsyslogd
3030 root 20 0 100m 4500 3432 S 0.0 0.4 0:00.27 sshd
3032 root 20 0 105m 1996 1448 S 0.0 0.2 0:00.16 bash
836 root 20 0 24520 1904 1420 S 0.0 0.2 68: 20.81 AliYunDunUpdate
10589 ntp 20 0 26600 1504 980 S 0.0 0.1 0:38.68 ntpd
10540 nscd 20 0 615m 1420 932 S 0.0 0.1 0:21.77 nscd
10421 root 20 0 114m 1264 656 S 0.0 0.1 0:14.35 crond
10364 root 20 0 66236 1232 516 S 0.0 0.1 0:10.46 sshd
3719 root 20 0 15016 1196 944 R 0.0 0.1 0:00.03 top
310 root 20 0 152m 888 476 S 0.0 0.1 0:00.48 svnserve
1 root 20 0 19232 828 536 S 0.0 0.1 0:03.18 init
9724 root 16 -4 10648 820 432 S 0.0 0.1 0:00.08 udevd
For example, after pressing N:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
10589 ntp 20 0 26600 1504 980 S 0.0 0.1 0:38.68 ntpd
10540 nscd 20 0 615m 1420 932 S 0.0 0.1 0:21.77 nscd
10511 root 20 0 243m 4864 868 S 0.0 0.5 0:11.77 rsyslogd
10421 root 20 0 114m 1264 656 S 0.0 0.1 0:14.35 crond
10364 root 20 0 66236 1232 516 S 0.0 0.1 0:10.46 sshd
9724 root 16 -4 10648 820 432 S 0.0 0.1 0:00.08 udevd
9016 root 20 0 704m 64m 4852 S 0.0 6.5 37:30.27 PM2 v2.2.1: God
7313 root 20 0 286m 8948 3248 S 0.3 0.9 392:16.83 AliHids
6579 root 20 0 1011m 128m 5732 S 0.0 12.9 83:01.55 node /var/www/g
5428 mysql 20 0 694m 35m 2876 S 0.0 3.6 35:29.60 mysqld
5311 root 20 0 105m 676 436 S 0.0 0.1 0:00.00 mysqld_safe
4266 root 18 -2 10644 640 256 S 0.0 0.1 0:00.00 udevd
3728 root 20 0 0 0 0 S 0.0 0.0 0:00.00 flush-202:0
3719 root 20 0 15016 1196 944 R 0.0 0.1 0:00.04 top
3032 root 20 0 105m 1996 1448 S 0.0 0.2 0:00.16 bash
3030 root 20 0 100m 4500 3432 S 0.0 0.4 0:00.27 sshd
1026 root 20 0 4064 372 304 S 0.0 0.0 0:00.00 mingetty
4. free to view the memory space usage:
-g GB units
-m MB
-k KB
In the following: The system has a total of 994M memory; swap has 0M
The free memory is 115M, and among the used 879M memory, 182 and 319 M are used for buffer and cache respectively.
[root@niewj server]# free -m total used free shared buffers cached Mem: 994 879 115 0 182 319 -/+ buffers/cache: 376 617 Swap: 0 0 0 [root@niewj server]#
http://blog.csdn.net/guolong1983811/article/details/53471314
5. uptime
Show how long the system has been up and running, and the average load for 1,5,15 minutes:
[root@niewj server]# uptime 18:30:02 up 124 days, 3:23, 1 user, load average: 0.14, 0.08, 0.09