我用du看子目录大小,但是如果加-h参数,出来的就是带单位的那种,不能用sort排序
不加-h是对的
# sudo du |sort -n -r
28692 .
12980 ./installer
11640 ./installer/cdebconf
2784 ./samba
68 ./apt
12 ./samba/cores
12 ./fsck
4 ./unattended-upgrades
4 ./samba/cores/smbd
4 ./samba/cores/nmbd
4 ./news
4 ./mysql
4 ./landscape
4 ./dist-upgrade
4 ./apparmor
加了-h参数就是郁闷的。。。
# sudo du -h |sort -n -r
68K ./apt
29M .
13M ./installer
12M ./installer/cdebconf
12K ./samba/cores
12K ./fsck
4.0K ./unattended-upgrades
4.0K ./samba/cores/smbd
4.0K ./samba/cores/nmbd
4.0K ./news
4.0K ./mysql
4.0K ./landscape
4.0K ./dist-upgrade
4.0K ./apparmor
2.8M ./samba