[root@localhost ~]# du -sh /root/ 查看目录的大小
80K /root/
[root@localhost ~]# du -sh /boot/
99M /boot/
[root@localhost ~]# du -sh /etc/passwd 查看文件的大小
4.0K /etc/passwd
[root@localhost ~]# ls -lh /etc/passwd
-rw-r--r--. 1 root root 1.2K 11月 1 16:20 /etc/passwd
- ls -lh和du -sh查看文件的大小不同,里面设计到块的大小
[root@hf-01 ~]# du -s /root/
496 /root/
[root@hf-01 ~]# du -sh /root/
496K /root/
[root@hf-01 ~]# du /etc/passwd
4 /etc/passwd
[root@hf-01 ~]# du /root/
0 /root/hf
0 /root/123
0 /root/234/am
0 /root/234/am1
0 /root/234/asddf
0 /root/234
0 /root/6666
0 /root/7777
496 /root/
[root@hf-01 ~]#