Mastering Disk Space Management with ncdu: A Sysadmin's Best Friend

🚀 One of my go-to tools for managing disk space is ncdu! It’s lightweight, fast, and perfect for getting a clear overview of disk usage on both local machines and remote servers.

Here’s why I use ncdu:

User-Friendly Interface: Easily browse through directories and identify what’s taking up space.

Fast and Efficient: Whether it’s a large filesystem or remote server via SSH, it gets the job done quickly.

Direct File Deletion: You can delete files straight from the ncdu interface without switching tools.

Terminal-Based: Great for headless servers or when you don’t have access to a GUI.

Here’s how you can install and use it:

Ubuntu/Debian:

sudo apt update && sudo apt install ncdu

CentOS/RHEL:

sudo yum update && sudo yum install ncdu

macOS (with Homebrew):

brew update && brew install ncdu

How to Use ncdu

Once you’ve installed ncdu, here are a few commands to start analyzing your disk space usage:

Scan the current directory:

ncdu

Scan a specific directory (e.g., /home):

ncdu /home

Here is image of scanned disk usage of all system directories:

If you’re managing disk space on a server or just want a clearer view of what’s filling up your drive, I’d highly recommend giving ncdu a try. It’s been a game-changer for me!

#DevOps #SysAdmin #Linux #ncdu #DiskManagement #Automation #DevOpsTools

2
Subscribe to my newsletter

Read articles from Mubinahmed Shaikh directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Mubinahmed Shaikh
Mubinahmed Shaikh