du -h -s * | sort -rn | head -5
如果要查其他目錄,只要修改上述 * 號,例如:
du -h -s /* | sort -rn | head -5
還有更方便的工具,但是需要額外安裝 ncdu
ncdu -q -x
-q Quiet mode, doesn't update the screen 10 times a second
while scanning, reduces network bandwidth used
-x Don't cross filesystem borders (don't descend into a
directory which is a mounted disk)