Ever found yourself stuck trying to understand the disk space consumption on your Ubuntu system? If so, you’ll want to check out the ncdu command which can help resolve this usage mystery.

Hеrе’s how to usе ncdu to check disk space usage on Ubuntu and make disk space management a hasslе-frее task.

Updating packages list on Ubuntu

Prerequisites: Installing ncdu on Ubuntu

First,open the terminaland update your system’s package info:

Next, install ncdu on your Ubuntu system:

To check you can now run ncdu, simply display its version:

How to Use ncdu on Ubuntu

ncdu is a modern alternativeto the classic du command. This utility helps you to analyze the disk usage of any directory.

Lеt’s еxplorе some practical usе casеs of thе ncdu command.

1. Chеcking thе Disk Usagе of the Currеnt Dirеctory

Running ncdu without any options will display thе disk usagе of thе currеnt dirеctory:

2. Displaying Subdirectory Details

To select a subdirectory, you can use the up and down arrow keys. Then, press theikey to check the information of that subdirectory such as itsName,Path,Type,Disk usage, andApparent size:

3. Navigating to a Specific Subdirectory

To navigate to the selected subdirectory, just hit the right-arrow key:

View the relevant disk usage details and hit the left-arrow key to switch back to the parent directory.

Installing ncdu on Ubuntu

4. Checking Disk Space of the Root Directory

To check the disk usage of the root directory, use the-xoption with the forward-slash/.

The -x option instructs ncdu to only include files on the same filesystem:

Checking the version of ncdu on Ubuntu

The ongoing scan will take a few seconds to complete and then show the results:

5. Checking the Disk Usage of a Specific Directory

To visualize the disk usage of any specific directory, specifya relative or absolute path, just as you did for the root directory. For instance:

Uncover Disk Space Secrets With ncdu

By mastering ncdu, you may easily check and manage your storage, which makes your Ubuntu experience more efficient. So, take control of your system’s efficiency and organization and implement these tips to enjoy an optimized Ubuntu experience like never before.

Running the ncdu command on Ubuntu

Displaying the subdirectory details with ncdu on Ubuntu