ADJ網路實驗室
打印

[分享] 用 du 將目錄中的總容量算出來

用 du 將目錄中的總容量算出來

原始文章連結:
http://phorum.study-area.org/viewtopic.php?t=16977

怎麼用 du 將目錄中所有目錄的總容量算出來?
要算的是目錄中各個子目錄分別的容量,指令可以這樣下...
#du -cSh /path/*


如果不懂的話...可以 man du ...用底下的方式..更一目了然囉...
#du -h --max-depth=2 /path/*
複製內容到剪貼板
代碼:
--max-depth=N
       print the total for a directory (or file, with --all) only if it
       is   N   or  fewer  levels  below  the  command  line  argument;
       --max-depth=0 is the same as --summarize
試試看囉...滿有用的..





TOP

ARTERY.cn