How to install and use NCDU program

Install and use NCDU program - Disk Usage Tracker and Analyzer

Methods to install and use NCDU program is explained in this article.

ncdu Installation (Disk Usage of NCurses)

For the Installation of ncdu in Red-hat based systems, You must enable epel repository on your computer.
# yum install ncdu
You can utilize “ ncdu” from the package manager system on Linux Mint, Ubuntu, and Debian.
Utilize the apt-get command for Ubuntu based systems

root@linuxhelp:~# apt-get install ncdu
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  ncdu
0 upgraded, 1 newly installed, 0 to remove and 66 not upgraded.
Need to get 37.5 kB of archives.
After this operation, 89.1 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 ncdu amd64 1.11-1build1 [37.5 kB]
Fetched 37.5 kB in 1s (31.8 kB/s)
Selecting previously unselected package ncdu.
(Reading database ... 173152 files and directories currently installed.)
Preparing to unpack .../ncdu_1.11-1build1_amd64.deb ...
Unpacking ncdu (1.11-1build1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up ncdu (1.11-1build1) ...

ncdu Usage

From the terminal, execute the “ ncdu” command. It will scan for the disk usage of present working directory.

root@linuxhelp:~# ncdu

Tree View and Sizes

Once the scanning is completed, it will display the tree structure of folders and files in human readable format together with their disk usage in graphical bar presentation.

Information of Directory

To view the information of the selected directory like disk usage, full path, and apparent size, Press “ i” key.

To hide the window, again press “ i” key.

To Delete the Content

To delete selected directory or file, press “ d” key. You will be directed for confirmation, before deleting it.

Select “ Yes” or “ No“ .

Help Window of ncdu

To view the help window containing ncdu available options, Press “ Shift+?” keys.
Once the Help screen appears. You can toggle between keys, format and about using arrow keys.
1.Keys



2.Format



3.About


To quit the interface, press“ q” .

Tag : NCDU
FAQ
Q
It is possible to scan the remote system?
A
Yes, you can scan a remote system, but browse through the files locally, run this command
$ ssh -C localhost: ncdu -o- / | ncdu -f-
Q
How to install NCDU in federo?
A
By using this you can install
Syntax: "sudo dnf install ncdu"
Q
How to avoid being scanned in the mounted devices using NCDU?
A
By using this commadn you can avodi
Syntax: "sudo ncdu -x /"
Q
How to install NCDU in SuSe Linux?
A
By using this command you can install
Syntax: "zypper install ncdu"
Q
How to check the manual page for NCDU?
A
By using this command you can check the manual page
Syntax: " man ncdu"