To quickly see which directories are taking up the most space on your Linux system, use this simple command:
du -h --max-depth=1 | sort -h
Explanation:
du -h
: Displays directory sizes in a human-readable format (KB, MB, GB).--max-depth=1
: Limits the output to the top-level directories.sort -h
: Sorts the output by size, from smallest to largest. The-h
flag is used to sort human-readable numbers, like those produced bydu -h
.
Example Output:
11G .
6.5G ./splunk
4.6G ./.cache
12K ./.bearlychilly
0 ./.ssh