du (display disk usage)
Displays the amount of disk space used by a directory and each subdirectory.
Format: du directory_name
Examples: du
du /home/janet
If the directory named is omitted, the current directory is used. The size is displayed as the number of KB blocks.
Opt | What It Does | Example |
---|---|---|
-a | List all files, not just subdirectories | du -a |
-b | Display size in bytes | du -b |
-c | Display grand total | du -c |
-m | Display size in megabytes | du -m |
-s | Display only the grand total | du -s |
Get Spring Into Linux® 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.