Skip to content

Open-Technology-Foundation/dux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dux - Quick Directory Size Overview

Bash License

Find out where your disk space is going in seconds.

$ dux /var
4.0KiB    /var/empty
52.0KiB   /var/mail
1.2MiB    /var/backups
23.4MiB   /var/cache
156.8MiB  /var/lib
512.3MiB  /var/log

What It Does

dux shows you the size of each subdirectory, sorted smallest to largest. Use it to:

  • Find space hogs - Quickly identify which directories are consuming disk space
  • Plan cleanup - See at a glance what to delete or archive
  • Monitor growth - Check which directories are growing over time

Installation

One-liner (user install):

git clone https://github.com/Open-Technology-Foundation/dux.git && cd dux && ./install.sh

One-liner (system-wide):

git clone https://github.com/Open-Technology-Foundation/dux.git && cd dux && sudo ./install.sh

The installer sets up:

  • dux command (symlink to dir-sizes)
  • Bash completion
  • Man page (man dux)

To uninstall: ./install.sh --uninstall

Usage

dux [OPTIONS] [DIRECTORY]
Option Description
-L Follow symlinks
-q, --quiet Suppress permission errors
-h, --help Show help
-V, --version Show version

Common Tasks

Where is my disk space going?

dux ~              # Check home directory
dux /              # Check entire filesystem (may need sudo)

Find the largest directories:

dux /var | tail -5         # Show 5 largest in /var
sudo dux / | tail -10      # Show 10 largest on system

Check a project for bloat:

dux ~/projects/myapp       # Find large folders in project

Pipe to other tools:

dux . | grep -v node_modules   # Exclude node_modules
dux /home | tee sizes.txt      # Save output to file

Follow symlinks:

dux -L /opt/myapp              # Include symlinked directories

Output Format

<size>    <path>
  • Sizes use IEC units: B, KiB, MiB, GiB, TiB
  • Output is tab-separated (easy to parse with cut, awk)
  • Sorted smallest to largest (largest at bottom for visibility)

Handling Permissions

Permission errors appear on stderr but don't stop execution:

dux /var                   # Shows errors inline
dux -q /var                # Suppress errors with --quiet
sudo dux /var              # Full access to all directories

Exit Codes

Code Meaning
0 Success
1 Error (invalid directory, failed to read)
2 Too many arguments
22 Invalid option

Requirements

  • Bash 5.2+
  • GNU coreutils (du, sort, numfmt)

Why dux?

dux du -h ncdu dust
Sorted output Yes No* Yes Yes
Human-readable Yes Yes Yes Yes
One command Yes No* Yes Yes
Interactive No No Yes No
Dependencies coreutils coreutils ncurses Rust

*du requires piping through sort -h for sorted human-readable output

dux fills the gap between raw du output and full-featured tools like ncdu. It's the quick answer to "what's using my disk space?" without installing additional software.

License

GPL-3.0 - See LICENSE

See Also

About

A fast and efficient Bash utility for analyzing and displaying directory sizes in human-readable format.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors