LinuxAlternative

Linux · System Tools

ncdu

A fast, interactive command-line tool for analyzing disk usage with a tree-like interface.

Open sourceFree
Be the first to rate
License
GPL-3.0
Latest version
2.11.1

What is ncdu?

ncdu (NCurses Disk Usage) is a lightweight command-line utility that scans your filesystem to show where space is being used. It has been around for many years and is a staple in Linux system administration. Its design prioritizes speed and low resource usage, making it ideal for servers and older hardware where graphical tools might feel sluggish.

It is primarily aimed at system administrators, developers, and power users who are comfortable with the terminal. If you prefer keyboard-driven workflows and want to quickly identify large directories without opening a GUI, ncdu is the standard choice. It runs directly in your terminal, allowing you to analyze disk usage remotely via SSH without needing X forwarding.

Compared to WinDirStat, which uses a visual treemap, ncdu uses a text-based tree view. While less visually intuitive at first glance, it is significantly faster and more precise for navigation. You move through directories using arrow keys rather than clicking, which many users find more efficient once they get used to the interface. It lacks the colorful block visualization but compensates with superior performance and simplicity.

Best for: System administrators and terminal users who need to quickly identify disk usage on local or remote Linux systems.

Key features of ncdu

  • Interactive tree view of directory sizes
  • Sorts directories by size by default
  • Fast scanning with low memory footprint
  • Supports analyzing remote directories via SSH
  • Can save and load scan results for later review
  • Keyboard-driven navigation without mouse
  • Shows file count and total size per directory
  • Runs in any standard terminal emulator

Pros

  • Extremely fast and lightweight
  • No GUI dependencies required
  • Easy to install on almost any Linux distro
  • Precise navigation for large filesystems

Cons

  • Steep learning curve for non-CLI users
  • Lacks visual treemap representation
  • No built-in file deletion (must use other tools)
  • Interface can feel sparse compared to GUI tools

Windows programs ncdu replaces

How to install ncdu on Linux

Ubuntu / Mintsudo apt install ncdu
Debiansudo apt install ncdu
Fedorasudo dnf install ncdu
Arch / Manjarosudo pacman -S ncdu
openSUSEsudo zypper install ncdu

Tips for Windows users

If you are coming from WinDirStat, expect to give up the visual treemap for a text-based list. Use the arrow keys to navigate down into directories and the 'd' key to delete files (requires confirmation). There is no direct equivalent to clicking a block to see details; instead, you navigate to the directory to see its contents. For a visual experience, consider using 'dust' or 'duf' if you find ncdu too abstract, but for raw speed, ncdu is hard to beat. Remember that it analyzes the current user's accessible files by default; use sudo to scan system directories.

ncdu: frequently asked questions

How do I delete a file in ncdu?

Navigate to the file or directory and press the 'd' key. You will be asked for confirmation before the item is removed.

Can ncdu scan remote servers?

Yes, you can use the '-x' flag or simply run ncdu on a remote path if you have SSH access, though direct remote scanning is limited compared to dedicated tools.

Why is ncdu faster than WinDirStat?

ncdu uses a text-based interface and optimized C code, avoiding the overhead of rendering complex graphics. It also processes data in a streaming manner where possible.

Does ncdu support saving scan results?

Yes, you can save the current scan to a file using the 's' key and reload it later without rescanning the disk.

Updated