tldr/pages.zh/osx/du.md

29 lines
815 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# du
> 磁盘使用率:估计和汇总文件和目录空间使用率。
> 更多信息:<https://keith.github.io/xcode-man-pages/du.1.html>.
- 以给定单位KiB/MiB/GiB列出目录和所有子目录的大小
`du -{{k|m|g}} {{目标文件夹}}`
- 以可读形式列出目录和任何子目录的大小(即自动为转换为选择的适当单位 kb|mb|gb
`du -h {{目标文件夹}}`
- 以可读单位显示目录大小:
`du -sh {{目标文件夹}}`
- 列出目录以及其中所有文件和目录的可读大小:
`du -ah {{目标文件夹}}`
- 列出一个目录和任何子目录的可读大小,最深可达 n 级:
`du -h -d {{N}} {{目标文件夹}}`
- 列出当前目录子目录中所有.jpg 文件的可读大小,并在末尾显示累计总数:
`du -ch {{*/*.jpg}}`