ncdu - NCurses Disk Usage
Disk space management is a critical task for any Linux user or administrator. Enter ncdu
(NCurses Disk Usage) - an incredibly useful interactive tool that combines the functionality of commands like du
and df
with a user-friendly interface.
What is 'ncdu'?
ncdu
is a disk usage analyzer with an NCurses interface. It provides a clear, interactive view of your directory structure and file sizes, making it easy to identify what's consuming your valuable disk space.
Key Features
- Interactive interface: Navigate directories with arrow keys
- Size-sorted display: Files and directories are shown in descending size order by default
- Disk usage calculation: Quickly determines space usage across directories
- Directory scanning: Rapidly scans and displays results as it works
- Deletion capability: Remove files directly from the interface (with confirmation)
- Export functionality: Save scans for later review
Basic Usage
ncdu /path/to/directory
If no path is specified, ncdu
will analyze the current directory.
Navigation and Commands
While using ncdu
, you can:
- Use arrow keys to navigate
- Press
Enter
to explore a directory - Press
d
to delete the selected item - Press
g
to toggle between different display modes - Press
q
to quit
Why Choose 'ncdu'?
Unlike command-line tools like du
that provide static output, ncdu
offers an interactive experience that makes it significantly easier to track down space-hogging files and directories. It's particularly useful when:
- Troubleshooting a "disk full" error
- Performing system maintenance
- Cleaning up old or unnecessary files
- Analyzing disk usage patterns
Installation
On most Linux distributions, ncdu
isn't installed by default, but it's readily available:
# Debian/Ubuntu
sudo apt install ncdu
# Fedora
sudo dnf install ncdu
# Arch Linux
sudo pacman -S ncdu
The next time you're wondering where all your disk space went, remember that ncdu
offers a simple, efficient way to visualize and manage your storage resources!
- ← Previous
less is more - Next →
gotop