Ncdu a NCurses Based Disk Usage Analyzer and Tracker

ncdu (NCurses Disk Usage) is a command line version of the most popular “du command“. It is based on ncurses and provides a fastest way to analyse and track what files and directories are using your disk space in Linux. It provides an excellent ncurses based interface to display the information in more intuitive way like columns for how much disk space used in megabytes, gigabytes and graphical bar usage, file/directory names, file deletion, refresh, etc. ncdu aims to be simple, fast and easy to use program and runs on any minimal Linux/Unix based system with ncurses installed.

ncdu commands

Install NCDU Tool

This article explains you through the process of installing and using NCDU program on a Linux system.

Installing ncdu (NCurses Disk Usage)

The “ncdu” package is not available under RHEL, CentOS, Fedora, Scientific Linux distributions, you must have epel repository enabled on your system to install it using yum command.

# yum install ncdu

The “ncdu” utility is available on Ubuntu, Linux Mint and Debian from the package manager system, use the following apt-get command to install it.

$ sudo apt-get install ncdu

How Do I Use ncdu

Simply, run the “ncdu” command from the terminal. Once you run, it will start scanning for number of files and directories and disk usage of current working directory.

# ncdu
NCDU Scanning

NCDU Scanning

Tree View With Sizes

Once, scanning completes, it will present the tree structure of files and folders along with their disk usage in human readable format with graphical bar presentation.

NCDU Disk Usage Tree View

NCDU Disk Usage Tree View

Directory Information

Press “i” to see the selected directory information like full path, disk usage, apparent size. Again, hit “i” to hide the window.

NCDU Directory Information

NCDU Directory Information

Delete Confirmation

Press “-d” to delete selected file or directory, before deleting it will prompt you for confirmation. Press “Yes” or “No“.

NCDU Delete Confirmation

NCDU Delete Confirmation

ncdup Help Window

Press “Shift+?” to see help window with ncdu available options. You can use arrow keys to move up and down for more options.

NCDU Help Screen

NCDU Help Screen

Use “q” to quit interface. Here are list of available options for ncdu, you can check them.

 ┌───ncdu help─────────────────1:Keys───2:Format───3:About─────┐
 │         						       │
 │   up, 	k  Move cursor up                              │
 │   down, 	j  Move cursor down                            │
 │   right/enter   Open selected directory                     │
 │   left, <, 	h  Open parent directory                       │
 │   	      	n  Sort by name (ascending/descending)         │
 │   		s  Sort by size (ascending/descending)         │
 │ 		d  Delete selected file or directory           │
 │  		t  Toggle dirs before files when sorting       │
 │  		g  Show percentage and/or graph                │
 │ 		a  Toggle between apparent size and disk usage │
 │		e  Show/hide hidden or excluded files          │
 │           	i  Show information about selected item        │
 │           	r  Recalculate the current directory           │
 │           	q  Quit ncdu                                   │
 │          	                                               │
 │                                     Press q to continue     │
Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

5 Responses

  1. Wasim says:

    Hi.. i moved a large file nearly 130Gb from one directory to another directory but i wondering the space is still the same.. Can you please let mw know why its been same

    • Ravi Saive says:

      Moving large size files from one directory to another will not reduce size, it still remains same size as you moving the data in the same server…

  2. nitesh says:

    Is there any option u are aware of where we can disable the delete option. Coz my team mate accidently deleted some important data while browsing through ncdu output.

  3. gekvprasad says:

    Your blog is having loads of practical information especially for linux administrator……Thank you

  4. yss says:

    Nice pack. Thanks :)

Leave a Reply to yss Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.