Files
tldr/pages.zh/osx/du.md
2021-10-21 17:34:54 -03:00

29 lines
790 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# du
> 磁盘使用率:估计和汇总文件和目录空间使用率。
> 更多信息:<https://ss64.com/osx/du.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`