#disk #du #disk-usage #visualization #filesystem #cli

app durs

Durs: A fast, intuitive disk usage analyzer in Rust. Quickly assess file system space with efficient, clear visualizations and insights.

4 releases

0.1.4 Dec 9, 2024
0.1.3 Nov 30, 2024
0.1.2 Nov 17, 2024
0.1.0 Oct 26, 2024

#1525 in Command line utilities

Download history 110/week @ 2024-10-24 27/week @ 2024-10-31 6/week @ 2024-11-07 103/week @ 2024-11-14 17/week @ 2024-11-21 151/week @ 2024-11-28 209/week @ 2024-12-05 66/week @ 2024-12-12

450 downloads per month

MIT license

770KB
3K SLoC

Rust 2.5K SLoC // 0.0% comments BASH 185 SLoC PowerShell 96 SLoC Elvish 93 SLoC Shell 25 SLoC

πŸ“‰ Durs

     _
  __| | _   _  _ __  ___
 / _` || | | || '__|/ __|
| (_| || |_| || |   \__ \
 \__,_| \__,_||_|   |___/

πŸ“‰ Durs: A fast, intuitive disk usage analyzer in Rust. Quickly assess file system space with efficient, clear visualizations and insights.

Demo

durs

✨ Features

Durs quickly shows which directories are using the most disk space without needing extra commands like sort or head. If there’s a folder you don’t have permission to access, Durs will display just one message Did not have permissions message for it and continue scanning.

It displays the largest files or folders that can fit on your terminal screen, going deep into the file structure to find the biggest items automatically. This removes the need for -d or -h flags, keeping things simple. The largest directories are highlighted with color for easy identification.

The color bars reflect both the directory structure and disk usage, with shades of gray to show folder hierarchy. For example, if .steam is a large folder using 44% of space, lighter gray lines from .steam show subfolders inside it. This helps you see that deleting .steam would also remove everything inside it.

πŸš€ Installation

To install durs, simply clone the repository and follow the instructions below:

git clone https://github.com/trinhminhtriet/durs.git
cd durs

cargo build --release
cp ./target/release/durs /usr/local/bin/
durs --version

Running the below command will globally install the durs binary.

cargo install durs

πŸ’‘ Usage

Usage: durs
Usage: durs <dir>
Usage: durs <dir>  <another_dir> <and_more>
Usage: durs -p (full-path - Show fullpath of the subdirectories)
Usage: durs -s (apparent-size - shows the length of the file as opposed to the amount of disk space it uses)
Usage: durs -n 30  (Shows 30 directories instead of the default [default is terminal height])
Usage: durs -d 3  (Shows 3 levels of subdirectories)
Usage: durs -D (Show only directories (eg durs -D))
Usage: durs -F (Show only files - finds your largest files)
Usage: durs -r (reverse order of output)
Usage: durs -o si/b/kb/kib/mb/mib/gb/gib (si - prints sizes in powers of 1000. Others print size in that format).
Usage: durs -X ignore  (ignore all files and directories with the name 'ignore')
Usage: durs -x (Only show directories on the same filesystem)
Usage: durs -b (Do not show percentages or draw ASCII bars)
Usage: durs -B (--bars-on-right - Percent bars moved to right side of screen)
Usage: durs -i (Do not show hidden files)
Usage: durs -c (No colors [monochrome])
Usage: durs -C (Force colors)
Usage: durs -f (Count files instead of diskspace)
Usage: durs -t (Group by filetype)
Usage: durs -z 10M (min-size, Only include files larger than 10M)
Usage: durs -e regex (Only include files matching this regex (eg durs -e "\.png$" would match png files))
Usage: durs -v regex (Exclude files matching this regex (eg durs -v "\.png$" would ignore png files))
Usage: durs -L (dereference-links - Treat sym links as directories and go into them)
Usage: durs -P (Disable the progress indicator)
Usage: durs -R (For screen readers. Removes bars/symbols. Adds new column: depth level. (May want to use -p for full path too))
Usage: durs -S (Custom Stack size - Use if you see: 'fatal runtime error: stack overflow' (default allocation: low memory=1048576, high memory=1073741824)"),
Usage: durs --skip-total (No total row will be displayed)
Usage: durs -z 40000/30MB/20kib (Exclude output files/directories below size 40000 bytes / 30MB / 20KiB)
Usage: durs -j (Prints JSON representation of directories, try: durs -j  | jq)
Usage: durs --files0-from=FILE (Reads null-terminated file paths from FILE); If FILE is - then read from stdin

Config file

Durs has a config file where the above options can be set. Either: ~/.config/durs/config.toml or ~/.durs.toml

$ cat ~/.config/durs/config.toml
reverse=true

πŸ—‘οΈ Uninstallation

Running the below command will globally uninstall the durs binary.

cargo uninstall durs

Remove the project repo

rm -rf /path/to/git/clone/durs

🀝 How to contribute

We welcome contributions!

  • Fork this repository;
  • Create a branch with your feature: git checkout -b my-feature;
  • Commit your changes: git commit -m "feat: my new feature";
  • Push to your branch: git push origin my-feature.

Once your pull request has been merged, you can delete your branch.

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

Dependencies

~11–22MB
~336K SLoC