|Initial release||February 21, 2007|
|Operating system||Linux, BSD, macOS|
ncdu (NCurses Disk Usage) is a shell utility that lets you quickly and easily see how much space the sub-folders in a directory are using. It gives you the same information
du does in a much more convenient way.
ncdu is very fast, you will not have to wait noticeably long even if you have very large folders with lots and lots of files in them.
You can use the ↑ and ↓ arrows to navigate between folders and enter folders by pressing ↵ Enter. ncdu supports very basic file management, you can eradicate files by pressing d. Pressing d will give you a warning, so you won't accidentally remove files less you select
n, s and c can be used to sort files by name, size and item name respectively.
t toggles if directories should be shown before files or not. g toggles the size graph, on by default, on or off.
The standard q for quit key closes
ncdu will, by default, show you the sizes of sub-folders in the current folder. You can point elsewhere by providing a folder as an argument. It only takes one; only the last folder you list is the only one it cares about if you try to point it at more than one.
ncdu can, optionally, export the directory sizes in the folder you run it on by specifying the
-o command line option.
ncdu will, by default, give you a plain two-colored black and white interface (or other two-colored interface, your terminal colors may vary). It has a
--color option that allows you to start it with multiple colors so directory sizes have one colors and file listings have another. While it is supposed to support color schemes, there's currently only one available: dark. The only valid parameters for turning color on is therefore
ncdu --color dark. You may want to make this an alias for
ncdu since it does not have, or support, any configuration file.
You can start
--si if you prefer sizes in powers of then (KB, MB) instead of powers of 1024 (KiB, MiB). See multiples of bytes if you don't get the difference.
The ncdu manual page lists several other options including a
-e option for "extended information".
ncdu /folder/ and
ncdu -e /folder/ looks exactly the same, so it is unclear to us what, if any, additional information the
-e option is supposed to show.
Verdict And Conclusion
ncdu is really useful if you want to quickly see what folders are using most of your disk storage space. It is one of those tools you will likely use a lot once you have become aware of its existence. And now you are.
All the distributions have
ncdu available as a package with that name. A few like Alpine Linux separate the documentation into a option package named
ncdu-doc (most include the documentation in the
- Console: du, duc, gdu, gt5
- Graphical: Filelight, GNOME Disk Usage Analyzer, Graphical Disk Map (gdmap), MATE Disk Usage Analyzer, qdirstat
- nixCraft: "How to install ncdu on Linux / Unix to see disk usage"
- ncdu manual page