Easily check directories sizes
Sometimes I wanna check the size of some directories and see how much space they're occupying. Log files can get really big if you don't truncate them from time to time.
An easy way to do that is through the command line utility du
To see this list of directories and the size of them, type
du -d 1 -h
-d
is the argument for the depth of directories that should be shown and its sizes and -h
is argument for human output of sizes (it adds the K suffix when kilobyte, M when megabyte and so on).
Written by Rodrigo Flores
Related protips
2 Responses
Yeah often I use 'du -sh *'
over 1 year ago
·
Sometimes you need to be root to read folders. And it's useful to sort results by size. So:
alias dus = 'sudo du -hs *|sort -h'
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Command line
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#