Monitor your space with NCurses Disk Usage tool — aka NCDU
Hey everybody
Today I want to share with you a useful tool that I use to analyze and track disk usage on Linux systems. It is called ncdu, which stands for NCurses Disk Usage. It is a command line version of the popular du command, but with a graphical interface that makes it easy to navigate and sort directories and files by size.
Ncdu is very fast and simple to use, and it can run on any Linux or Unix system with ncurses installed. It also has some handy features, such as deleting files or directories, showing percentage and graph, and toggling dirs before files when sorting.
To install ncdu on Linux, you can use your distro’s package manager. For example, on Debian/Ubuntu, you can run:
sudo apt install ncdu
On CentOS/Fedora, you can run:
sudo yum install ncdu
Or:
sudo dnf install ncdu
To use ncdu, you just need to run:
ncdu /dir_name/
for instance
ncdu temp-space/
ncdu’s pretty text interface will give you the details to analyze your disk consumption of the related directory :
Moreover, you can navigate through the arrow keys (up, down, left, right), sort files and directories (n, s, C), delete files or directories (d), change views (a,c,m,e,i) or open a shell in the selected directory (b)
As you see, it is super-simple but yet super-easy tool for your everyday Linux system management needs.