frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

[Debian/Ubuntu] How to install ncdu - disk usage analyzer for Linux

MichailMichail Moderator
edited May 20 in Linux Applications

Introduction

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).

Installation and Use Guide

1. Update system

First, update the system:

apt update

Then run the upgrade command:

apt upgrade

2. Install ncdu

To install ncdu run this command:

apt install ncdu

3. Launch the 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.

4. Navigation in ncdu

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.

5. Sort files and directories in ncdu

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+?.

6. Delete files and directories in ncdu

To delete file or directory, select it with ncdu and press -d.

Ncdu will prompt you to confirm the removal. Select "Yes" or "No".

7. More information about ncdu

To see information about all the options, press Shift+?. It will show you the ncdu "help" window:

8. Exit from ncdu

To exit from ncdu, simply press q.

Conclusion

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.

Sign In or Register to comment.

Time4VPS

Learn how to install a web and database server, email, FTP client or other applications. Discover and share information on server security or optimization recommendations.
Feel free to join our constantly expanding community, participate in discussions, strengthen your knowledge on Linux and Windows server management!
© 2013 - 2024 Time4VPS. All rights reserved.

Get In Touch