Name
du [options
] [files
| directories
] — coreutils
Synopsis
/usr/bin
stdin stdout - file -- opt --help --version
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 8 ./Notes 36 ./Mail 340 ./Files/mine 40 ./Files/bob 416 ./Files 216 ./PC 2404 .
However, it can also measure the size of files:
$ du myfile myfile2 4 ./myfile 16 ./myfile2
Useful options | |
| Measure usage in bytes ( |
| Display sizes in blocks that you define, where 1 block = |
| Print “human readable” output, and choose the most appropriate unit for each size. 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 |
| Following symbolic links and measure the files they point to. |
| Print only the total size. |
Get Linux Pocket Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.