Friday, 26 September 2014

How to check the size of folder through terminal

The command "du" is used to list the number of blocks, files are occupying in the current working directory.

To make it in human readable format, -h extension is used.

To not list all files individually and simply print the total size, -s is used.

Thus:
du -h -s

lists the size of the current working directory in K/M/Gb.

if you want to know size of some specific directory, just specify path to the command. Ex:

du -h -s path