BSD du Cheatsheet
#
du
estimates and reports the disk usage of files and directories. It provides information on the disk space used by files and directories in BSD systems.
Basic Usage
#
Command/Option | Example | Description |
---|
du | du | Display disk usage of the current directory and its subdirectories |
du -h | du -h | Show sizes in human-readable format (e.g., KB, MB, GB) |
du -k | du -k | Show sizes in kilobytes (default) |
du -m | du -m | Show sizes in megabytes |
du -s | du -s | Display only the total for each argument |
Specific Directories
#
Command/Option | Example | Description |
---|
du /path | du /home/user | Display disk usage for the specified path |
Advanced Usage
#
Command/Option | Example | Description |
---|
du -d <depth> | du -d 2 | Limit the depth of directory traversal |
This cheatsheet covers essential du
commands and options for BSD systems.