du Command Generator
Generate du commands to estimate file and directory space usage
Getting Started with du
## What is du?
The `du` command estimates disk space used by files and directories. It walks a directory tree and reports sizes, making it the standard tool for finding what's eating your disk.
## How to Use
1. **Set Format**: Enable `-h` (human-readable) and `-s` (summary) — both on by default for a clean total. 2. **Choose Depth**: Use `--max-depth` to break a directory into its top-level subdirs. 3. **Set Path (optional)**: Defaults to the current directory; pass any path to analyze. 4. **Copy & Run**: Copy the generated command into your terminal.
Common Options
### `-h` Human-readable Print sizes with K/M/G suffixes. Enabled by default — almost always what you want for interactive inspection.
### `-s` Summarize Show only one total per argument instead of listing every subdirectory. The fastest way to answer "how big is this folder?"
### `-c` Grand total Append a `total` line summing all listed paths. Useful when checking several directories at once.
### `-a` All files Report every file, not just directories. Produces a lot of output but lets you spot individual large files.
### `--max-depth` Depth limit Show subdirectories only up to N levels deep. `du -h --max-depth=1 /var` is the classic recipe for finding the biggest top-level directory under a path.
### `--count` File count Report the number of files instead of byte sizes — handy for finding directories with an excessive file count.
▶How do I find the largest directories under a path?
▶Why does `du` sometimes report less than the file's apparent size?
▶How do I exclude a subdirectory?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee