duc
Index and inspect disk usage
TLDR
Index the /usr directory, writing to the default database location ~/.duc.db
List all files and directories under /usr/local, showing relative file sizes in a graph
List all files and directories under /usr/local using treeview recursively
Start the graphical interface to explore the file system using sunburst graphs
Run the ncurses console interface to explore the file system
Dump database info
SYNOPSIS
duc <command> [options] [arguments]
Common commands include:
duc index [options] <path> [<path> ...]
duc ls [options] <path>
duc ui [options] <path>
duc gui [options] <path>
PARAMETERS
-x, --one-file-system (for index)
Do not cross filesystem boundaries during indexing.
-f, --force (for index)
Force re-indexing of an already indexed path, discarding old data.
-p, --progress (for index)
Show indexing progress.
-l, --level <N> (for ls)
Display directory contents up to N levels deep.
-t, --threshold <SIZE> (for ls)
Only show items larger than the specified SIZE (e.g., 1G, 500M).
-s, --size-only (for ls)
Display only the size, without names or path information.
-H, --http <PORT> (for gui)
Start an HTTP server for the web GUI on the specified PORT.
-d, --database <PATH> (general)
Specify an alternative database file path instead of the default (~/.duc.db).
-h, --help (general)
Display help message for a command or subcommand.
DESCRIPTION
duc is a command-line tool that provides a fast and efficient way to analyze disk usage. Unlike traditional tools like du, duc builds a database of file system statistics, which allows for extremely rapid queries and updates. It can show disk usage of directories and files, offering different views including a summary, a tree view, and an interactive curses-based browser (similar to ncdu). Additionally, duc can generate static HTML reports or even serve a dynamic web interface for exploring disk usage. Its database-driven approach makes it particularly useful for large file systems where repeated du scans would be slow. It supports indexing multiple file systems and provides various options for filtering and displaying information.
CAVEATS
Initial indexing can take a significant amount of time for very large file systems.
The duc database can grow large depending on the amount of indexed data, potentially consuming considerable disk space.
File system changes (additions, deletions, size changes) are not reflected until duc index is run again for the affected paths.
DATABASE LOCATION
By default, the duc database is stored in ~/.duc.db. This path can be changed using the -d or --database option. The database stores file system metadata and sizes, not the file contents themselves.
INTERACTIVE UI
The duc ui command provides an interactive, curses-based user interface that allows users to navigate through the directory structure, inspect sizes, and identify large files or directories efficiently. It offers a user experience similar to ncdu but benefits from duc's fast database lookups.
WEB GUI
The duc gui command launches a local web server, providing a graphical web interface for exploring disk usage. This can be very useful for sharing reports with others or for users who prefer a browser-based visualization of disk space.
HISTORY
duc was developed by Arnout Engelen and first released around 2008. Its primary motivation was to address the slowness of du on very large file systems by leveraging a persistent database (SQLite by default) to store scan results, enabling much faster subsequent queries and interactive browsing. It has seen continuous development, adding features like a Text User Interface (TUI), a web-based Graphical User Interface (GUI), and various output formats, establishing itself as a robust and efficient alternative for disk usage analysis.