check disk usage for each directory in the current path and sort the output from high to low
du -h --max-depth=1 | sort -hr
Explanation:
du -h --max-depth=1
→ Shows disk usage in a human-readable format (-h
), only for directories at the first level (--max-depth=1
).sort -hr
→ Sorts the output in human-readable format (-h
), in reverse order (-r
) so that the largest directories appear first.
