Skip to content

Instantly share code, notes, and snippets.

@afsardo
Last active July 29, 2017 11:42
Show Gist options
  • Save afsardo/599ce2496dc5e8cfe22b273fd84eef93 to your computer and use it in GitHub Desktop.
Save afsardo/599ce2496dc5e8cfe22b273fd84eef93 to your computer and use it in GitHub Desktop.
This will give you the used space for all child folders.

Check used space dirs Ubuntu

Last week there was a disk space problem on an AWS instance, we couldn't figure out where space was being used.

The good old ls / ll wasn't going to cut it, had to search a way to discover what folder was taking up so much space.

Starting from the root $ cd / I used the command below:

$ du -hcsx .[!.]* * | sort -rh | head

With the help of that command, I was able to drill down to the folder that had up to 100GB total size in files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment