How to use ncdu to check disk space in Ubuntu

If so, you'll want to see how the ncdu command can help solve this problem.

Here's how to use ncdu to check disk space usage on Ubuntu and make disk space management an easy task.

Prerequisites: Install ncdu on Ubuntu

First, open terminal and update your system package information:

sudo apt update

How to use ncdu to check disk space in Ubuntu Picture 1

Next, install ncdu on your Ubuntu system:

sudo apt install ncdu

How to use ncdu to check disk space in Ubuntu Picture 2

 

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

ncdu -version

How to use ncdu to check disk space in Ubuntu Picture 3

How to use ncdu on Ubuntu

ncdu is a modern replacement for the classic du command. This utility helps you analyze the disk usage of any folder.

Let's explore some practical use cases of the ncdu command.

1. Check the disk usage of the current folder

Running ncdu without any options displays the current directory's drive usage:

ncdu

How to use ncdu to check disk space in Ubuntu Picture 4

2. Display subfolder details

To select a subfolder, you can use the up and down arrow keys. Then, press the i key to check the information of that subfolder such as Name, Path, Type, Disk usage and Apparent size:

How to use ncdu to check disk space in Ubuntu Picture 5

 

3. Navigate to a specific subfolder

To navigate to the selected subfolder, simply press the right arrow key:

How to use ncdu to check disk space in Ubuntu Picture 6

View relevant drive usage details and press the left arrow key to switch back to the parent folder.

4. Check the disk space of the root directory

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

sudo ncdu -x /

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

How to use ncdu to check disk space in Ubuntu Picture 7

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

How to use ncdu to check disk space in Ubuntu Picture 8

 

5. Check the disk usage of a specific folder

To visualize the disk usage of any given folder, specify the relative or absolute path, just like you did with the root folder. For example:

ncdu ~/snap

How to use ncdu to check disk space in Ubuntu Picture 9

By mastering ncdu, you can easily test and manage your memory, 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.

4 ★ | 1 Vote

May be interested

  • Free up hard drive space automatically on Windows 10 with Disk CleanupFree up hard drive space automatically on Windows 10 with Disk Cleanup
    disk cleanup is one of the 'maintenance' tools built into windows for a long time. this tool allows users to free up more space on the computer by 'cleaning up' the temporary files and the file system is almost no longer usable, but takes up quite a bit of space, unlike files. information to install and update previous windows versions.
  • How to install Ubuntu in parallel with Windows using USBHow to install Ubuntu in parallel with Windows using USB
    installing ubuntu in parallel with windows 7 and 8 with usb will help users not to waste time writing files to disk, running on many different computers.
  • What's New in Ubuntu 21.10?What's New in Ubuntu 21.10?
    version 21.10 is the latest release of ubuntu and although canonical is turning more attention to the cloud and developers, ubuntu 'impish indri' still comes with some notable changes for those users use the ubuntu desktop every day.
  • How to clean up junk files to reduce disk space CHow to clean up junk files to reduce disk space C
    how to clean up junk files to reduce disk space c. after a long time using the computer, temporary files will generate junk files and take up hard disk space, sometimes they will make our computer work. no longer as smooth as before. we should correspond
  • Disk Quotas configuration in Windows 2003Disk Quotas configuration in Windows 2003
    are you looking for means of managing storage space allocated to users? you can use disk quotas. this article gives you an overview of disk quota in windows 2003. we have reviewed the reasons why ch & u
  • How to Free up Hard Disk Space on Windows VistaHow to Free up Hard Disk Space on Windows Vista
    as the windows vista os becomes more entrenched in the market, fewer users will look towards older operating systems. this guide will present a range of methods to troubleshoot a lack of hard disk space your computer may suffer from; vista...
  • How to access user activity on LinuxHow to access user activity on Linux
    if you are using a linux server, you can use the following commands to check user activity - when system users log in and frequency of use, which group they belong to, and how much disk space they are currently running. consumption, what command are they running, how much disk space is taking up, ...
  • Best application to help recover disk spaceBest application to help recover disk space
    spacesniffer has the ability to analyze hard drive and folder structure in an impressive and fast way that no other application can do the same.
  • Check and fix hard drive errors with chkdsk on WindowsCheck and fix hard drive errors with chkdsk on Windows
    whenever there is a hard drive error or even strange behavior, users can rarely think of check disk as 'savior'. this article will show you how to use the check disk tool that comes with all versions of windows.
  • Why is Ubuntu LTS preferred over regular distros?Why is Ubuntu LTS preferred over regular distros?
    ubuntu is one of the most widely used linux distributions among software developers and other content creators. ubuntu is also used for many servers around the globe.