facebook youtube pinterest twitter reddit whatsapp instagram

Installing and Using NCDU (NCurses Disk Usage)

ncdu is a curses-based version of the well-known 'du' command and provides a fast way to see what directories are using your disk space.

What I love about this utility is that it can traverse the results without having to run the command over and over in different directories. The way it works is you execute the command once and then you can navigate the results, go into multiple sub-directories, and vice versa.

Let's install ncdu:

sudo apt install ncdu

Once it is installed, run ncdu in your terminal, it doesn't matter where you are on your diectory.

Note: The du command is only able to scan directories that its calling user has permission to scan. So, you might want to scan using root to get the full sizes.

Also, it will scan every directory from its starting point onward.

Scanning the  home directory:

ncdu ~user


--- /home/pascal -------------------------------------------------------------------------------
   32.0 KiB [##########] /.siege
   16.0 KiB [#####     ]  .bash_history
   16.0 KiB [#####     ] /.ssh
   12.0 KiB [###       ] /.local
   12.0 KiB [###       ] /.config
    8.0 KiB [##        ] /.gnupg
    8.0 KiB [##        ] /mynotes
e   4.0 KiB [#         ] /backup
    4.0 KiB [#         ] /.cache
    4.0 KiB [#         ]  .bashrc
    4.0 KiB [#         ]  cars.sql
    4.0 KiB [#         ]  wget-log
    4.0 KiB [#         ]  .rnd
    4.0 KiB [#         ]  .note-1.swp
    4.0 KiB [#         ]  .profile
    4.0 KiB [#         ]  .mysql_history
    4.0 KiB [#         ]  .bash_logout
    4.0 KiB [#         ]  .wget-hsts
    4.0 KiB [#         ]  .selected_editor
    4.0 KiB [#         ]  .lesshst
    4.0 KiB [#         ]  note-2
    4.0 KiB [#         ]  note-1
@   0.0   B [          ]  notes
    0.0   B [          ]  .sudo_as_admin_successful

As you can see the result above, it gave us a menu-driven layout allowing you to browse through.

At the top is my current directory, use the up and down arrows to move your selection. If you press Enter on a directory, ncdu switches to showing you the summary of that directory, and you can continue to go down as far as you want.

To delete a file or folder, you simply press the d, use the q to quit.

Related Post(s)

  • Send Mail with Attachment Using Mutt in GNU/Linux

    Mutt is a powerful text-based mail client for Unix/Linux operating systems. It features color support, message threading, MIME support...

  • Using Pageant To Automatically Authenticate SSH key in Putty

    I can't count how many times I have typed my ssh key passphrase whenever my ssh connection times out, it is so annoying and repetitive. Well, thanks to the putty pageant, you can do that seamlessly.

  • Installing WP-CLI In a GNU/Linux Server

    WP-CLI is a command-line interface for WordPress. It can also be used with ClassicPress, as they are no differences in their usage, maybe just minimal if you are updating or downloading new ClassicPr

  • Installing and Running Rclone Mount As a Windows Service

    I previously wrote a guide on how to mount and unmount rclone in Linux, in this guide, I’ll walk you through on how to do the same on a windows system. Step 1: Download Rclone First, go to rclone d

  • How To Send Mail To Multiple Addresses Using (mailx)

    In this guide, you'll learn a couple of ways you can send mail to multiple addresses using mailx. mailx is a utility program for sending and receiving mail. I assume you already have mailx command, i

  • Mounting and Unmounting Cloud Storage With (Rclone) in GNU/Linux

    Ever wondered if you could mount your preferred cloud storage as a virtual drive on your system? Thanks to Rclone, you can mount and access different kinds of cloud storage from a file manager, I'll