NCDU(1)
๐ NCDU ๐ โ the NCDU(1) girlie manual
okay so this is NCDU(1), straight outta the General Commands Manual, and bestie it's giving essential. we're gonna walk through every single flag together, no skips, no skimming, periodt. ๐ฆ
โจ NAME โจ
ncdu โ NCurses Disk Usage. that's it, that's the name, iconic. ๐
โจ SYNOPSIS โจ
ncdu [-f file] [-o file] [-O file] [-e, --extended, --no-extended]
[--ignore-config] [-x, --one-file-system, --cross-file-system]
[--exclude pattern] [-X, --exclude-from file]
[--include-caches, --exclude-caches]
[-L, --follow-symlinks, --no-follow-symlinks]
[--include-kernfs, --exclude-kernfs] [-t, --threads num]
[-c, --compress, --no-compress] [--compress-level num]
[--export-block-size num] [-0, -1, -2]
[-q, --slow-ui-updates, --fast-ui-updates]
[--enable-shell, --disable-shell]
[--enable-delete, --disable-delete]
[--enable-refresh, --disable-refresh] [-r] [--si, --no-si]
[--disk-usage, --apparent-size] [--show-hidden, --hide-hidden]
[--show-itemcount, --hide-itemcount] [--show-mtime, --hide-mtime]
[--show-graph, --hide-graph] [--show-percent, --hide-percent]
[--graph-style hash | half-block | eighth-block]
[--shared-column off | shared | unique] [--sort column]
[--enable-natsort, --disable-natsort]
[--group-directories-first, --no-group-directories-first]
[--confirm-quit, --no-confirm-quit]
[--confirm-delete, --no-confirm-delete] [--delete-command command]
[--color off | dark | dark-bg] [path]
ncdu [-h, --help]
ncdu [-v, -V, --version]
look at all those options, we're gonna get through all of them, one by one, like the devoted besties we are ๐ธ
โจ DESCRIPTION โจ
ncdu (that's NCurses Disk Usage, obviously) is an interactive curses-based version of the well-known du(1), and it gives you a fast way to see what directories are eating your disk space. no cap. it's literally the glow-up du deserved. ๐
โจ OPTIONS โจ
๐ Mode Selection ๐
-h,--helpโ prints a short lil help message and dips. that's it, that's the whole job. ๐ซถ-v,-V,--versionโ prints the version and bounces. three whole ways to say "who am i". slay.-ffile โ loads the given file, which was earlier created with the-oor-Oflag. and if file is equivalent to-, the file gets read from standard input โ but bestie, listen, reading from standard input is only supported for the JSON format. ๐
and for the sake of preventing a screw-up, the current version of ncdu assumes that the directory information in the imported file does not represent the filesystem on which the file is being imported. which means: the refresh, file deletion and shell spawning options in the browser are all disabled. it's a safety thing, we love a cautious queen. ๐
- dir โ scans the given directory. the classic. the main character move. ๐
-ofile โ exports the directory tree in JSON format to file instead of opening the browser interface. if file is-, the data goes to standard output. (peep the examples section further down for some handy use cases, iykyk.) โจ
โ ๏ธ be warned bestie: the exported data can get HUGE when you're exporting a directory with many files. like,10.000files will get you an export in the order of 600 to 700 KiB uncompressed, or a little over 100 KiB when compressed withgzip. this scales linearly, so be prepared to handle a few tens of megabytes when you're dealing with millions of files. no one is coming to save you. ๐ญ
consider enabling -c to output Zstandard-compressed JSON โ it can significantly reduce the size of the exported data. ๐
and when you're running a multi-threaded scan, or scanning a directory tree that may not fit in memory, consider using -O instead. ๐ง
-Ofile โ exports the directory tree in binary format to file instead of opening the browser interface. if file is-, the data is written to standard output. the binary format has built-in compression, supports low-memory multi-threaded export (in combination with-t) and can be browsed without importing the entire directory tree into memory. it's giving efficiency, it's giving forethought. ๐ฅ-e,--extended,--no-extendedโ enable/disable extended information mode. this reads the usual file info plus the ownership, permissions and last modification time for each file. the cost? higher memory usage (by roughly ~30%) and a larger output file when exporting. ๐ธ
when using the file export/import function, this flag should be added both when exporting (so the info actually makes it into the export) and when importing (so it gets read into memory). this flag has no effect when importing a file that was exported without the extended information. ๐
also: this is what unlocks viewing and sorting by the latest child mtime, or modified time, using m and M, respectively. ๐
--ignore-configโ do not attempt to load any configuration files. we're going rogue, we're raw-dogging the defaults. ๐
๐ Scan Options ๐
these options affect the scanning progress โ they have no effect when importing directory information from a file. noted. ๐
-x,--one-file-systemโ do not cross filesystem boundaries. i.e. only count files and directories on the same filesystem as the directory being scanned. stay in your lane, babe. ๐--cross-file-systemโ do cross filesystem boundaries. this is the default, but you can specify it to overrule a previously configured-x. sometimes you gotta un-set the vibe. ๐--excludepattern โ exclude files that match pattern. the files are still displayed by default, but they are not counted towards the disk usage statistics. this argument can be added multiple times to add more patterns. stacking them like accessories. ๐-X,--exclude-fromfile โ exclude files that match any pattern in file. patterns should be separated by a newline. ๐--include-caches,--exclude-cachesโ include (that's the default) or exclude directories containingCACHEDIR.TAG. excluded cache directories are still displayed, but their contents will not be scanned or counted towards the disk usage statistics. (https://bford.info/cachedir/) ๐๏ธ-L,--follow-symlinks,--no-follow-symlinksโ follow (or not) symlinks and count the size of the file they point to. heads up though: this option does not follow symlinks to directories, and it will cause each symlinked file to count as a unique file. that's different from how hard links are handled. and fr fr, the exact counting behavior of this flag is subject to change in the future. โ ๏ธ--include-kernfs,--exclude-kernfsโ (Linux only) include (the default) or exclude Linux pseudo filesystems such as/proc(procfs) and/sys(sysfs). ๐ง
the complete list of currently known pseudo filesystems is: binfmt, bpf, cgroup, cgroup2, debug, devpts, proc, pstore, security, selinux, sys, trace.
-t,--threadsnum โ number of threads to use when scanning the filesystem. defaults to1. ๐งต
in single-threaded mode, the JSON export (see -o) can operate with very little memory. but in multi-threaded mode the entire directory tree is first constructed in memory and written out after the filesystem scan has completed. this causes a delay in output and requires significantly more memory for large directory trees. ๐ฌ the binary format (see -O) does not have this problem and supports efficient exporting with any number of threads. periodt. ๐
๐ค Export Options ๐ค
these options affect behavior when exporting to file with the -o or -O options.
-c,--compress,--no-compressโ enable or disable Zstandard compression when exporting to JSON (see-o). โจ--compress-levelnum โ set the Zstandard compression level when using-Oor-c. valid values are1(fastest) to19(slowest). defaults to4. dial it up if you've got time to burn, bestie. ๐ฅ--export-block-sizenum โ set the block size, in kibibytes, for the binary export format (see-O). larger blocks require more memory but result in better compression efficiency. this option can be combined with a higher--compress-levelfor even better compression. ๐
accepted values are between 4 and 16000. the default is to start at 64 KiB and then gradually increase the block size for large exports. ๐ฆ
๐ฅ๏ธ Interface Options ๐ฅ๏ธ
-0โ don't give any feedback while scanning a directory or importing a file, except when a fatal error occurs. ncurses will not be initialized until the scan is complete. and when exporting the data with-o, ncurses will not be initialized at all. this option is the default when exporting to standard output. silent. mysterious. ๐คซ-1โ write progress information to the terminal, but don't open a full-screen ncurses interface. this option is the default when exporting to a file. ๐
heads up: in some cases, the ncurses browser interface you'll see after the scan/import is complete may look garbled when using this option. if you're not exporting to a file, -2 is usually a better choice. ๐ญ
-2โ show a full-screen ncurses interface while scanning a directory or importing a file. this is the only interface that provides feedback on any non-fatal errors while scanning. the full glam experience. ๐-q,--slow-ui-updates,--fast-ui-updatesโ change the UI update interval while scanning or importing.ncduupdates the screen 10 times a second by default (that's with--fast-ui-updates); this can be decreased to once every 2 seconds with-qor--slow-ui-updates. use this to save bandwidth over remote connections. ๐ this option has no effect in combination with-0.--enable-shell,--disable-shellโ enable or disable shell spawning from the file browser. this feature is enabled by default when scanning a live directory, and disabled when importing from file. ๐--enable-delete,--disable-deleteโ enable or disable the built-in file deletion feature. this is enabled by default when scanning a live directory and disabled when importing from file. explicitly disabling the deletion feature can work as a safeguard to prevent accidental data loss. ๐ก๏ธ--enable-refresh,--disable-refreshโ enable or disable directory refreshing from the file browser. enabled by default when scanning a live directory, disabled when importing from file. ๐-rโ read-only mode. when given once, this is an alias for--disable-delete. when given twice it will also add--disable-shell, thus ensuring that there is no way to modify the file system from withinncdu. the ultimate "look but don't touch" setting. ๐ซ--si,--no-siโ list sizes using base 10 prefixes, that is, powers of 1000 (kB,MB, etc), as defined in the International System of Units (SI), instead of the usual base 2 prefixes (KiB,MiB, etc). metric girlies rise. ๐--disk-usage,--apparent-sizeโ pick what you wanna see: disk usage (that's the default bestie, don't stress) or the apparent sizes. You can also flip this live in the file browser with theakey ๐--show-hidden,--hide-hiddenโ show (default, we love a visible queen) or hide those "hidden" and excluded files. Toggle it in the browser witheโจ--show-itemcount,--hide-itemcountโ show or hide (hide is the default, soz) the item counts column. Live toggle in the browser:c๐--show-mtime,--hide-mtimeโ show or hide (again, hide is the default) the last modification time column. Browser toggle ism. Heads up: this one is ignored when you're not in extended mode, so go look at-e๐ฆ--show-graph,--hide-graphโ show (default) or hide the relative size bar column. Toggle it in the browser withg๐ธ--show-percent,--hide-percentโ show (default) or hide the relative size percent column. Also toggled withgin the browser ๐--graph-style hash | half-block | eighth-blockโ how should that relative size bar column be drawn, bestie? Recognized values:hashdraws ASCII#characters (that's the default and the most portable, periodt),half-blockuses half-block drawing characters, andeighth-blockuses eighth-block drawing characters. Eighth-block is the most precise but ngl it may not render correctly in all terminals ๐ญ--shared-column off | shared | uniqueโ set it tooffto kill the shared size column for directories,shared(the default) to show shared directory sizes as a separate column, oruniqueto show unique directory sizes as a separate column. You can also cycle through these in the file browser with theukey ๐ฅ--sort columnโ change the default column we sort on. Accepted values aredisk-usage(the default, obvs),name,apparent-size,itemcountormtime. The last one only makes sense in extended mode, so see-e๐
You can suffix the column name with -asc or -desc to change the order to ascending or descending, respectively. Like, for example, --sort=name-desc sorts by name in descending order. Slay ๐
--enable-natsort,--disable-natsortโ enable (default) or disable natural sort when you're sorting by file name ๐--group-directories-first,--no-group-directories-firstโ sort (or don't) directories before files ๐ซถ--confirm-quit,--no-confirm-quitโ require a confirmation before quitting ncdu. Genuinely helpful when you accidentally pressqduring or after a very long scan and you have a tiny heart attack ๐ญ--confirm-delete,--no-confirm-deleteโ require a confirmation before deleting a file or directory. Enabled by default, but you can turn it off if you're absolutely sure you won't accidentally pressd๐--delete-command commandโ set this to a non-empty string and it replaces the built-in file deletion feature with your own custom shell command โจ
The absolute path of the item to be deleted gets appended to the given command and the whole thing is evaluated in a shell. The command runs from the same directory that ncdu itself was started in. The NCDU_DELETE_PATH environment variable is set to the absolute path of the item to be deleted, and NCDU_LEVEL is set the same way as when you spawn a shell from within ncdu ๐
After the command finishes, the in-memory view of the selected item is refreshed and directory sizes are adjusted as necessary. It is not a full refresh of the complete directory tree, so if the item has been renamed or moved to another directory, its new location is not automatically picked up. no cap, be aware ๐
Like, for example, to use rm(1) interactive mode to prompt before each deletion:
ncdu --no-confirm-delete --delete-command 'rm -ri --'
Or to move files to trash:
ncdu --delete-command 'gio trash --'
--color off | dark | dark-bgโ set the color scheme ๐จ Recognized schemes:offdisables colors,darkis a color scheme intended for dark backgrounds, anddark-bgis a variation of the dark color scheme that also works in terminals with a light background.
The default is off.
๐ธ CONFIGURATION ๐ธ
You can configure ncdu by placing command-line options in /etc/ncdu.conf or $HOME/.config/ncdu/config ๐ซถ If both files exist, the system configuration gets loaded before the user configuration, which lets users override options set in the system configuration. Options given on the command line will override options set in the configuration files. And the files won't be read at all when --ignore-config is given on the command line, so there ๐
The configuration file format is simply one command line option per line. Lines starting with # are ignored. A line can be prefixed with @ to suppress errors while parsing the option. Example configuration file:
# Always enable extended mode
-e
# Disable file deletion
--disable-delete
# Exclude .git directories
--exclude .git
# Read excludes from ~/.ncduexcludes, ignore error if the file does not exist
@--exclude-from ~/.ncduexcludes
โจ KEYS โจ
Okay bestie, here's the whole keyboard vibe check โจ๏ธ๐
?โ Open help + keys + about screen ๐ธup,down,j,kโ Cycle through the items ๐ฆright,enter,lโ Open selected directory ๐left,<,hโ Go to parent directory โฌ๏ธnโ Order by filename (press again for descending order) ๐คsโ Order by filesize (press again for descending order) ๐ฆCโ Order by number of items (press again for descending order) ๐ขaโ Toggle between showing disk usage and showing apparent size ๐Mโ Order by latest child mtime, or modified time (press again for descending order). Requires the-eflag โฐdโ Delete the selected file or directory. An error message will be shown when the contents of the directory do not match or do not exist anymore on the filesystem ๐tโ Toggle dirs before files when sorting ๐gโ Toggle between showing percentage, graph, both, or none. Percentage is relative to the size of the current directory, graph is relative to the largest item in the current directory ๐uโ Toggle display of the shared / unique size column for directories that share hard links. This column is only visible if the current listing contains directories with shared hard links ๐cโ Toggle display of child item counts ๐งฎmโ Toggle display of latest child mtime, or modified time. Requires the-eflag โฑ๏ธeโ Show/hide 'hidden' or 'excluded' files and directories. Be aware that even if you can't see the hidden files and directories, they are still there and they are still included in the directory sizes. If you suspect that the totals shown at the bottom of the screen are not correct, make sure you haven't enabled this option ๐iโ Show information about the current selected item โน๏ธrโ Refresh/recalculate the current directory ๐bโ Spawn shell in current directory ๐
ncdu determines your preferred shell from the NCDU_SHELL or SHELL environment variable (in that order), or calls /bin/sh if neither are set. This lets you also configure another command to be run when the b key is pressed. For example, to spawn the vifm(1) file manager instead of a shell, run ncdu as follows:
NCDU_SHELL=vifm ncdu
The NCDU_LEVEL environment variable is set or incremented before spawning the shell, allowing you to detect if your shell is running from within ncdu. This can be useful to avoid nesting multiple instances, although ncdu itself does not (currently) warn about or prevent this situation ๐
qโ Quit โ๏ธ
๐ FILE FLAGS ๐
Entries in the browser interface may be prefixed by a one-character flag. These flags have the following meaning, bestie โ learn them and you'll read the screen like a main character ๐
!โ An error occurred while reading this directory ๐ญ.โ An error occurred while reading a subdirectory, so the indicated size may not be correct ๐<โ File or directory is excluded from the statistics by using exclude patterns ๐ซ>โ Directory is on another filesystem ๐๏ธ^โ Directory is excluded from the statistics due to being a Linux pseudo filesystem ๐ง@โ This is neither a file nor a folder (symlink, socket, ...) โจHโ Same file was already counted (hard link) ๐eโ Empty directory ๐ซ
๐ EXAMPLES ๐
To scan and browse the directory you're currently in, all you need is a simple:
ncdu
To scan a full filesystem, for example your root filesystem, you'll want to use -x:
ncdu -x /
Since scanning a large directory may take a while, you can scan a directory and export the results for later viewing:
ncdu -1xO export.ncdu /
# ...some time later:
ncdu -f export.ncdu
To export from a cron job, make sure to replace -1 with -0 to suppress unnecessary progress output ๐คซ
You can also export a directory and browse it once scanning is done:
ncdu -co- | tee export.json.zst | ./ncdu -f-
To scan a system remotely, but browse through the files locally:
ssh user@system ncdu -co- / | ./ncdu -f-
Remote scanning and local viewing has two major advantages when compared to running ncdu directly on the remote system: You can browse through the scanned directory on the local system without any network latency, and ncdu does not keep the entire directory structure in memory when exporting, so this won't consume much memory on the remote system. iconic behaviour honestly ๐ฅ
๐ SEE ALSO ๐
du(1),tree(1).- Original project website (historical information and earlier versions):
https://dev.yorhel.nl/ncdu. - Current project website (releases, source code, issue tracker):
https://github.com/BratishkaErik/ncdu.
๐ AUTHORS ๐
Written by Yorhel <projects@yorhel.nl>
๐ BUGS (the tea on what's lowkey broken)
ok bestie, gather round, because we gotta be honest about the โจimperfectionsโจ. Nothing catastrophic, but you deserve to know fr fr.
- Directory hard links and firmlinks (MacOS) are not supported. They don't get detected as hard links, so they just get scanned and counted multiple times. It's giving "double dipping at the snack table" ๐๐.
- Some minor glitches may appear when displaying filenames that contain multibyte or multicolumn characters. Aesthetic only, no cap โ your files are fine, the display is just doing a lil dance ๐ .
- The unique and shared directory sizes are calculated based on the assumption that the link count of hard links does not change during a filesystem scan or in between refreshes. If that does happen โ like when a hard link gets deleted โ then those numbers will be very much incorrect ๐ญ and you'll need a full refresh by restarting
ncduto get correct numbers again. No shortcuts, bestie, just restart it ๐ซถ. - All sizes are internally represented as a signed 64bit integer. So if you somehow have a directory larger than 8 EiB minus one byte,
ncduwill clip its size to 8 EiB minus one byte. And when you're deleting or refreshing items in a directory with a clipped size, the resulting sizes will be incorrect. Likewise, item counts are stored in a 32-bit integer, so they'll be incorrect in the unlikely event that you happen to have more than 4 billion items in a directory. Likeโฆ if you're hitting that, honestly iconic, but also please go outside ๐ธ.
Please report any other bugs you may find at the bug tracker, which can be found on the web site at https://github.com/BratishkaErik/ncdu/issues. Do it for the girlies ๐. Actual bugs get fixed, and that's the real main character energy ๐.
and that's the whole page, bestie!! ๐ this one shipped with the Debian version, dated July 11, 2026, for the one and only NCDU(1) ๐ฆ. now go scan some disks and slay โจ๐๐
๐ฆ where this page comes from
- fedora 43: ncdu 2.11.1-1.fc43 ยท MIT
- fedora 44: ncdu 2.11.1-1.fc44 ยท MIT
- nixpkgs unstable: ncdu 2.11.1
- ๐ the page's license: MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms