Lyraa's Blog

利用 du 命令分析硬盘空间占用情况

2022-08-19

du -ah -d 1 / | sort -h
# 或者
du -sh /* | sort -h

命令参数说明:
du

-a:write counts for all files, not just directories

-h:print sizes in human readable format (e.g., 1K 234M 2G)

-d:展示的目录深度

-s:display only a total for each argument


sort(默认从小到大排列)

-h:compare human readable numbers (e.g., 2K 1G)


Tags: Linux

扫描二维码,分享此文章