01.磁盘
1.1 查看磁盘使
1. df -hl :查看磁盘使用情况
[root@linux-node1 ~]
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/cl-root 37G 2.9G 35G 8% /
devtmpfs 898M 0 898M 0% /dev
tmpfs 910M 16K 910M 1% /dev/shm
tmpfs 910M 34M 877M 4% /run
1.2 查看指定目录使用
2. df -h /home :查看指定目录磁盘使用情况
[root@linux-node1 ~]
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/cl-root 37G 2.9G 35G 8% /
1.3 查看大于1G文件夹
3.du -sh ./* | grep G : 查看当前目录下个文件大于1G的文件夹
[root@linux-node1 /]
2.2G ./usr
1.2G ./home
1.4 大于10M小于100M,倒序排列
4. find / -type f -size +10M -a -size -100M -print0 | xargs -0 du -h | sort -nr
: 查找文件大于10M小于100M,倒序排列
[root@linux-node1 /]
85M /usr/bin/docker
80M /var/lib/rpm/Packages
48M /usr/bin/containerd
47M /boot/initramfs-0-rescue-8b956f09fe0549c4b6182589acceab30.img
find / -type f -size +10M -a -size -100M
02.CPU
2.1 top
1.top :查看cpu 内存等使用情况
[root@linux-node1 /]
top - 03:24:29
up 4 days, 22:56,
2 users,
load average: 0.01, 0.03, 0.05
Tasks: 123 total(进程总数), 2 running(正在运行进程数), 121 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0
us, 0.0
sy, 0.0
ni,100.0
id, 0.0
wa, 0.0
hi, 0.0
si, 0.0
st
KiB Mem : 1863224 total(物理内存总量), 219592 free, 498732 used, 1144900 buff/cache
KiB Swap: 2097148 total(交换区总量), 2094580 free, 2568 used. 1043628 avail Mem
进程id 进程所有者 优先级
PID USER PR RES SHR S %CPU %MEM TIME+ COMMAND
6583 root 20 5156 3796 S 0.3 0.3 10:54.90 vmtoolsd
7284 root 20 2252 1580 R 0.3 0.1 0:00.03 top
1 root 20 3844 2436 S 0.0 0.2 2:04.28 systemd
2.2 查看CPU是用率
2. sar -u 1 5 : 每1秒采集一次CPU使用率,共采集5次
[root@linux-node1 /]
[root@linux-node1 /]
03:58:40 AM CPU %user %nice %system %iowait %steal %idle
03:58:41 AM all 0.00 0.00 3.61 0.00 0.00 96.39
03:58:42 AM all 0.00 0.00 0.00 0.00 0.00 100.00
03:58:43 AM all 0.00 0.00 0.00 0.00 0.00 100.00
Average: all 0.00 0.00 0.62 0.00 0.00 99.38
2.3 查看CPU基本信息
3. cat /proc/cpuinfo : 查看CPU基本信息
[root@linux-node1 ~]
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 142
model name : Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
stepping : 9
cache size : 4096 KB
physical id : 0
siblings : 1
cpu cores : 1
2.4 查看CPU个数
4. cat /proc/cpuinfo| grep “physical id”| sort| uniq| wc -l :查看CPU个数
[root@linux-node1 ~]
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 142
model name : Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
stepping : 9
cache size : 4096 KB
physical id : 0
siblings : 1
cpu cores : 1
03.内存
3.1 查询内存详情
1. free -m :查询内存详情
[root@linux-node1 ~]
total used free shared buff/cache available
Mem: 1819 486 190 32 1142 1020
Swap: 2047 2 2045
总内存 已使用 可用空间 多进程共享内存 磁盘缓存大小
3.2 查看内存详细信息
2. cat /proc/meminfo :查看内存详细信息
[root@linux-node1 ~]
MemTotal: 1863224 kB
MemFree: 195568 kB
MemAvailable: 1044924 kB
Buffers: 0 kB
3.3 vmstat查看内存
3. vmstat:查看内存
[root@linux-node1 shdir]
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 2568 181696 0 1057272 0 0 9 52 107 155 2 1 97 0 0
r
b
swpd
free
buff
cache
si
so
bi
bo
in
cs
us
sy
id
wt
3.4 显示内存使用详细信息
4. vmstat -s : 显示内存使用详细信息
[root@linux-node1 ~]
1863224 K total memory
497780 K used memory
599272 K active memory
620812 K inactive memory
188652 K free memory
0 K buffer memory
1176792 K swap cache
2097148 K total swap
2568 K used swap
2094580 K free swap
608294 non-nice user cpu ticks
625 nice user cpu ticks
539067 system cpu ticks
63631049 idle cpu ticks
15051 IO-wait cpu ticks
0 IRQ cpu ticks
10324 softirq cpu ticks
0 stolen cpu ticks
420669 pages paged in
3118282 pages paged out
7 pages swapped in
627 pages swapped out
73440819 interrupts
111933117 CPU context switches
1574604468 boot time
1097163 forks
04.负载
4.1 什么是系统平均负载?
什么是系统平均负载?
4.2 查询系统当前负载信息
1. uptime : 查询系统当前负载信息
[root@linux-node1 ~]
21:03:50 up 5 days, 5:14, 2 users, load average: 0.02, 0.04, 0.05
'''显示内容说明:'''
10:19:04
up 257 days, 18:56
12 user
load average
4.3 查看负载信息
2. cat /proc/loadavg :查看负载信息
[root@linux-node1 ~]
0.00 0.01 0.05 2/384 4482