- 文件大小倒序输出排名前10的文件
du -sh /home/li/* |sort -hr | head -n10
du: disk used
-s: --summarize display only a total for each argument
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
sort 排序
-h --human-numeric-sort compare human readable numbers (e.g., 2K 1G)
-r 反序
也可以通过-d (--max-depth)指定目录的层级 -k -m指定文件的统计单位
网友评论