Search code snippets, questions, articles...

Get total size of a directory or folder in Ubuntu

To get the total size of a directory or a folder in Ubuntu you can use du -hs command and it will print the total size of that directory using.
# If you are in same directory
du -hs

# If you are in different location
du -hs /path/to/directory

# If you want to list the size seperatyly for each sub directory
du -h | sort -h
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
Was this helpful?