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


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,

Android Android Commands Android Java Applications Application Libraries Application Stack / User Interface Bash / Shell Scripts Commands and Packages Compilation Content Management System - CMS Core Kernel C Programs Development & Build Development Environment Setup Errors & Failures Flutter git Go Language Programs Hardware Platforms HTML JAVA Programs Kernel & Device Drivers Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Monetization / Google AdSense NDK / Middleware / HAL OS Concepts PHP Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized User Interface Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply / Ask Question