Skip to content

Instantly share code, notes, and snippets.

@fotan
Created December 13, 2016 01:29
Show Gist options
  • Save fotan/120a0ba28fedd5b66ee8966264d28f21 to your computer and use it in GitHub Desktop.
Save fotan/120a0ba28fedd5b66ee8966264d28f21 to your computer and use it in GitHub Desktop.
LINUX - Output Directory Sizes
du -h --max-depth=1 /home/ | sort -h -r
du - Disk Usage command
print the total size of each folder under the /home/directory in human readable values (K, M, G) and sort -h -r
will sort them taking human readable values into account and will display the results in reverse order from largest fodler to smallest.
If u want largest folders last use only sort -h without -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment