DUSK is an interactive disk usage scanning and navigation tool written in Perl. It builds a one-time cached map of disk usage using a recursive du scan and lets you interactively navigate the directory tree via a terminal-based menu. Each file and directory is listed along with a human-readable size, a bar graph showing its relative disk usage compared to others, and a type indicator ("D" for directory, "F" for file). When a file is selected, an info box displays additional details such as owner, permissions, timestamps, and the output from the external file command.
This project was developed as a response to a client's decision not to install ncdu – a popular disk usage analyzer. Despite ncdu's powerful features, the client did not see any added benefit in installing a separate tool. DUSK was created to provide a similar interactive interface using only default tools available on Linux, allowing for disk usage analysis without external dependencies.
DUSK performs a one-time recursive scan using du -a -b to cache the entire file and directory tree in memory. This avoids repeated scanning during navigation.
Navigate through directories and files using arrow keys and enter your selection. A scrolling viewport ensures that the selected item is always visible.
Each item is displayed with:
- A human-readable size (e.g.,
27.0GB) - A bar graph representing its size relative to the largest item in the current directory
- A type column indicating whether the item is a directory (
D) or a file (F)
When a file is selected, an info box appears displaying additional details such as owner, group, permissions, modification/creation timestamps, and the output from the file command.
If a directory has many entries, a simulated progress message appears while the list is being generated, providing visual feedback that the scan is in progress.
Scan from the root directory (/):
./dusk.plIf scanning on a CPU starved host, try running this to ensure other processes are not in contention:
nice -n 10 taskset -c 0 perl dusk.pl
Start scanning from the current directory:
./dusk.pl --pwdStart scanning from a specified directory (use absolute paths for best performance):
./dusk.pl --path '/absolute/path/to/directory'- Use the up and down arrow keys to move through the list.
- The selection does not wrap around—navigation stops at the top and bottom of the menu.
- Selecting a directory navigates into that directory.
- Selecting a file displays a file information infobox.
- Use "Go up one level" to move back up in the directory tree.
- Press
qat any time to exit DUSK.
Since DUSK builds a complete disk map in memory during its one-time scan, it can be resource intensive, especially on systems with large file systems. It is recommended to use this tool with caution and on systems where you are aware of the disk usage.
For better performance and to avoid scanning an unnecessarily large directory tree (like /), it is advisable to run DUSK on specific, absolute paths rather than the entire root.
DUSK relies on the following standard Perl modules:
Term::ReadKey– For capturing interactive key presses and terminal size.Getopt::Long– For command-line option parsing.Storable– For caching the disk usage tree.POSIX– For formatting timestamps.
These modules are included by default in most Perl installations.
This project is provided "as is" without warranty of any kind. Use at your own risk.


