du
DisksFundamentals In simulator In real LinuxEstimate file and directory space usage
Name: du = disk usage
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
du reports the disk space used by files and directories, recursing into subdirectories. It counts allocated blocks, so even a tiny file takes at least one block (usually 4K).
To find what is filling a disk, du -sh * or du -h --max-depth=1 combined with sort -h works well.
Syntax
du [OPTION]... [FILE]...Common options
| -s / --summarize | Show only a total for each argument |
| -h / --human-readable | Human-readable sizes |
| -a / --all | List files as well as directories |
| -d / --max-depth N | Show totals only down to depth N |
| -c / --total | Add a grand total |
| --exclude PATTERN | Leave out files matching PATTERN |
| -x / --one-file-system | Skip other file systems mounted below |
| --apparent-size | Use the file sizes rather than disk blocks used |