du

GNU du Cheatsheet #

du estimates and reports the file space usage. It is used to display the amount of disk space used by files and directories.

Basic Usage #

Command/OptionExampleDescription
duduDisplay disk usage of the current directory and its subdirectories
du -hdu -hShow sizes in human-readable format (e.g., KB, MB, GB)
du -adu -aInclude all files, not just directories
du -sdu -sDisplay only the total for each argument
du -cdu -cProduce a grand total

Specific Directories #

Command/OptionExampleDescription
du /pathdu /home/userDisplay disk usage for the specified path
du -xdu -xStay on one file system, exclude other file systems

Advanced Usage #

Command/OptionExampleDescription
du --max-depth=<level>du --max-depth=2Limit the depth of directory traversal
du --exclude=<pattern>du --exclude=*.logExclude files matching the pattern
du --timedu --timeShow the time of last modification of files

This cheatsheet covers essential du commands and options for GNU systems.

du

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.