sh Bash:如何列出每个文件和目录的大小(递归)并按大小排序?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh Bash:如何列出每个文件和目录的大小(递归)并按大小排序?相关的知识,希望对你有一定的参考价值。

Simply navigate to directory and run following command:

du -a --max-depth=1 | sort -n
OR add -h for human readable sizes and -r to print bigger directories/files first.

du -a -h --max-depth=1 | sort -hr

以上是关于sh Bash:如何列出每个文件和目录的大小(递归)并按大小排序?的主要内容,如果未能解决你的问题,请参考以下文章