
Linux du(全称为 disk usage)命令用于查看目录或文件所占用的磁盘空间。
该命令会列出指定目录或文件的具体磁盘使用情况。
<code> du [-abcDhHklmsSx][-L ][-X ][--block-size][--exclude=][--max-depth=][--help][--version][目录或文件]</code>
常用参数说明:
查看当前目录下各个文件和目录的磁盘使用情况:
<code> # du 608 ./test6 308 ./test4 4 ./scf/lib 4 ./scf/service/deploy/product 4 ./scf/service/deploy/info 12 ./scf/service/deploy 16 ./scf/service 4 ./scf/doc 4 ./scf/bin 32 ./scf 8 ./test3 1288 .</code>
上述结果显示了当前目录下各子目录和文件的大小,最后一行的 1288 表示整个目录的总大小。
查看单个文件的大小:
<code> # du log2012.log 300 log2012.log</code>
以更直观的方式查看 test 目录的使用情况:
<code> # du -h test 608K test/test6 308K test/test4 4.0K test/scf/lib 4.0K test/scf/service/deploy/product 4.0K test/scf/service/deploy/info 12K test/scf/service/deploy 16K test/scf/service 4.0K test/scf/doc 4.0K test/scf/bin 32K test/scf 8.0K test/test3 1.3M test</code>
以上就是linux显示目录或文件大小是什么-du 命令使用与实例的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号