It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
Ncurse Disk Usage (or simply ncdu) is a disk analyzer that provides information about the distribution and use of disk space on a computer or server.
Ncdu works in text mode using the curses library, which allows you to display information in a human-readable format in the terminal. It scans the specified directory and provides detailed information about the size of directories and files.
In this guide, we will show how to install it on Debian (10,11 and 12) and Ubuntu (all versions).
First, update the system:
apt update
Then run the upgrade command:
apt upgrade
To install ncdu run this command:
apt install ncdu
Once the ncdu is installed, you can launch it by running this command:
ncdu
This command will scan your working directory and open the ncdu interface.
Once scanning is completed, ncdu will show you the structure of files and directories together with their disk usage:
To navigate through the files, use the arrow key. It will allow you to move up and down. To see information about selected directory (path, disk usage) press i
.
To hide this window, press i
again.
By default, files and directories are sorted by size. However, the ncdu interface offers different options for sorting them.
For example, you can sort them by name. For that, press n
.
To bring back the default option and sort by size, press s
.
To check all the options, press Shift+?
.
To delete file or directory, select it with ncdu and press -d
.
Ncdu will prompt you to confirm the removal. Select "Yes" or "No".
To see information about all the options, press Shift+?
. It will show you the ncdu "help" window:
To exit from ncdu, simply press q
.
Now you can easily analyze your server disk storage with the graphical interface of ncdu to identify what files/folders are taking the most space. The ncdu user-friendly interface allows you to free up space on your VPS quickly.