Name
du — stdin stdout - file -- opt --help --version
Synopsis
du [options] [files|directories]
The du (disk usage) command measures the disk space
occupied by files or directories. By default, it measures the current directory and all
its subdirectories, printing totals in blocks for each, with a grand total at the
bottom:
➜ du
6213880 ./Desktop
6440952 ./Documents
14237024 ./Downloads
430300 ./Library
11408 ./Library/Application Support
0 ./Library/Assistants
...
77797648 .It can also measure the size of files:
➜ du myfile myfile2
4 myfile
16 myfile2Useful options
| Measure usage in kilobytes. |
| Measure usage in megabytes. |
| Measure usage in gigabytes. |
| Print in human-readable
units. For example, if two directories are of size 1 gigabyte
or 25 kilobytes, respectively, |
| Print a total in the
last line. This is the default behavior when measuring a
directory, but for measuring individual files, provide
|
| Follow symbolic links and measure the files they point to. |
| Print only the total size. |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access