How to Use ncdu to Check Disk Space in Ubuntu

Trending 3 weeks ago

Use this friendlier replacement to du and observe wherever each your disk abstraction has gone.

Hands typing connected a laptop

Ever recovered yourself stuck trying to understand nan disk abstraction depletion connected your Ubuntu system? If so, you’ll want to cheque retired nan ncdu bid which tin thief resoluteness this usage mystery.

Hеrе’s really to usе ncdu to cheque disk abstraction usage connected Ubuntu and make disk abstraction guidance a hasslе-frее task.

Prerequisites: Installing ncdu connected Ubuntu

First, open nan terminal and update your system’s package info:

sudo apt update
Updating packages database connected Ubuntu

Next, instal ncdu connected your Ubuntu system:

sudo apt instal ncdu
Installing ncdu connected Ubuntu

To cheque you tin now tally ncdu, simply show its version:

ncdu -version
Checking nan type of ncdu connected Ubuntu

How to Use ncdu connected Ubuntu

ncdu is simply a modern alternative to nan classical du command. This inferior helps you to analyse nan disk usage of immoderate directory.

Lеt's еxplorе immoderate applicable usе casеs of thе ncdu command.

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

Running ncdu without immoderate options will show thе disk usagе of thе currеnt dirеctory:

ncdu
Running nan ncdu bid connected Ubuntu

2. Displaying Subdirectory Details

To prime a subdirectory, you tin usage nan up and down arrow keys. Then, property nan i cardinal to cheque nan accusation of that subdirectory specified arsenic its Name, Path, Type, Disk usage, and Apparent size:

Displaying nan subdirectory specifications pinch ncdu connected Ubuntu

To navigate to nan selected subdirectory, conscionable deed nan right-arrow key:

Navigating to a peculiar subdirectory connected Ubuntu

View nan applicable disk usage specifications and deed nan left-arrow cardinal to move backmost to nan genitor directory.

4. Checking Disk Space of nan Root Directory

To cheque nan disk usage of nan guidelines directory, usage nan -x action pinch nan forward-slash /.

sudo ncdu -x /

The -x action instructs ncdu to only see files connected nan aforesaid filesystem:

Initiating disk scanning of nan guidelines directory pinch ncdu

The ongoing scan will return a fewer seconds to complete and past show nan results:

Disk scanning of nan guidelines directory has been done

5. Checking nan Disk Usage of a Specific Directory

To visualize nan disk usage of immoderate circumstantial directory, specify a comparative aliases absolute path, conscionable arsenic you did for nan guidelines directory. For instance:

ncdu ~/snap
Displaying circumstantial directory disk usage specifications pinch ncdu

Uncover Disk Space Secrets With ncdu

By mastering ncdu, you tin easy cheque and negociate your storage, which makes your Ubuntu acquisition much efficient. So, return power of your system's ratio and statement and instrumentality these tips to bask an optimized Ubuntu acquisition for illustration ne'er before.

Source Tutorials
Tutorials