DUC (Disk Usage Collector) is a collection of tools for inspecting and visualizing disk usage on a Linux system. It allows users to easily analyze and understand the disk usage of their file systems, as well as identify any areas where disk space is being wasted or used inefficiently.
DUC is written in C and it uses SQLite as a database to store indexed data. It can run on most Linux distributions and it support for ext4, xfs, btrfs and other file systems.
If you encounter the below error while running the command duc:
duc: command not found
you may try installing the below package as per your choice of distribution:
Distribution | Command |
---|---|
Debian | apt-get install duc |
Ubuntu | apt-get install duc |
Kali Linux | apt-get install duc |
OS X | brew install duc |
Raspbian | apt-get install duc |
duc Command Examples
1. Index the /usr directory, writing to the default database location ~/.duc.db:
# duc index /usr
2. List all files and directories under /usr/local, showing relative file sizes in a [g]raph:
# duc ls -Fg /usr/local
3. List all files and directories under /usr/local using treeview recursively:
# duc ls -Fg -R /usr/local
4. Start the graphical interface to explore the file system using sunburst graphs:
# duc gui /usr
5. Run the ncurses console interface to explore the file system:
# duc ui /usr
6. Dump database info:
# duc info
Conclusion
Duc is a collection of tools for indexing, inspecting and visualizing disk usage. Duc maintains a database of accumulated sizes of directories of the file system, allowing queries this database, or create fancy graphs to show where data is.