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
Was this helpful?
0 Comments
Programming Feeds
Learn something new everyday on Devsheet