18.05.2025

How to install ncdu on Ubuntu 22.04

ncdu (NCurses Disk Usage) is an efficient and intuitive tool for analyzing disk space usage through the terminal. Unlike the traditional du command, ncdu offers a convenient text-based interface that simplifies navigation through directories, allows quick sorting of folders by occupied space, and visually highlights the "heaviest" files and directories.

This makes it easy and fast to identify where the main disk space consumption is concentrated on your server or computer. It is especially useful when you need to free up disk space, find large directories, or perform storage audits. Thanks to its lightweight and fast operation, ncdu is ideal for system administrators, developers, and users who need to manage disk resources efficiently without extra effort or using bulky graphical programs.

In this article, we will cover how to install and use ncdu on Ubuntu 22.04.

Step 1: Update the package list

Before installation, it is recommended to update the package information on your system. To do this, run:

sudo apt update

Step 2: Install ncdu

ncdu installation is done from Ubuntu’s standard repositories. Just run:

sudo apt install ncdu -y

The -y flag automatically confirms the installation.

Step 3: Run ncdu to analyze the disk

To analyze disk space usage in the current directory, simply run:

ncdu

If you want to check, for example, the root directory /, use:

sudo ncdu /

Using sudo allows you to gain permissions to view all files and folders.

Main features and controls

All in all

ncdu is an excellent tool for quick analysis and cleanup of disk space on a server or local machine running Ubuntu 22.04. Its simplicity and clarity make it an indispensable helper for system administrators and regular users alike.

Try installing and using ncdu to better understand what occupies space on your disk and manage your data storage more effectively.