什麼指令可以非遞歸地顯示特定目錄的磁碟使用情況?

什麼指令可以非遞歸地顯示特定目錄的磁碟使用情況?

我可以顯示目錄內容使用了多少磁碟空間,不包括其子目錄(及其內容)嗎?如果是這樣,請問什麼指令?謝謝。

答案1

摘錄du --help

-h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)
-S, --separate-dirs   do not include size of subdirectories
-s, --summarize       display only a total for each argument

跑步:

du -Shs /path/to/dir

應該給你你想要的。

相關內容