How to identify the total size of individual directories (folder) from the command line 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,
ncdu

Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply