How to Get the Size of a Directories in Linux ?

If you want to identify which folder in your disk is consuming more disk space, so as you can delete some of files / folders to free up the disk space, there is an excellent tool “ncdu” which shows the highest disk consuming directories at the top, and you can easily browse to the individual directories to identify what file / folder is using more space.

$ sudo apt-get install ncdu

Now go to the directory where you want to identify more disk consuming directories and type command, “ncdu”. In below example we will check for “/”

 $ cd /
 $ ncdu
ncdu

Now, lets say you want to check, what are the individual folders from “/var” which was consuming more disk space, then just use arrow to go to “/var” and press enter, and you will be navigated to screen as below,

Leave a Comment