1. Project Overview & Quickstart (Byron/dua-cli)
dua (-> Disk Usage Analyzer) is a tool to conveniently learn about the usage of disk space of a given directory. It's parallel by default and will max out your SSD, providing relevant information as fast as possible. Optionally delete superfluous data, and do so more quickly than rm.
Installation
Binary Release
MacOS
curl -LSfs https://raw.githubusercontent.com/Byron/dua-cli/master/ci/install.sh | \
sh -s -- --git Byron/dua-cli --crate dua --tag v2.29.0MacOS via [MacPorts](https://www.macports.org):
sudo port selfupdate
sudo port install dua-cliMacOS via [Homebrew](https://brew.sh)
brew update
brew install dua-cliLinux
Linux requires the target to be specified explicitly to obtain the MUSL build.
curl -LSfs https://raw.githubusercontent.com/Byron/dua-cli/master/ci/install.sh | \
sh -s -- --git Byron/dua-cli --target x86_64-unknown-linux-musl --crate dua --tag v2.29.0Windows via [Scoop](https://scoop.sh/)
scoop install duaWindows via [WinGet](https://learn.microsoft.com/en-us/windows/package-manager/winget/)
winget install Byron.dua-cliPre-built Binaries
See the releases section for manual installation of a binary, pre-built for many platforms.
Release archives include build provenance attestations. After downloading an archive, verify that it
was built by this repository with the GitHub CLI:
gh attestation verify ./dua-v2.39.1-aarch64-apple-darwin.tar.gz --repo Byron/dua-cliCargo
Via cargo, which can be obtained using rustup
For Unixβ¦
cargo install dua-cli
# And if you don't need a terminal user interface (most compatible)
cargo install dua-cli --no-default-features
# Compiles on most platforms, with terminal user interface
cargo install dua-cli --no-default-features --features tui-crossplatformFor Windows, nightly features are currently required.
cargo +nightly install dua-cliVoidLinux
Via xbps on your VoidLinux system.
xbps-install dua-cliFedora
Via dnf on your Fedora system.
sudo dnf install dua-cliArch Linux
Via pacman on your ArchLinux system.
sudo pacman -S dua-cliNixOS
https://search.nixos.org/packages?query=dua
Nix-shell (temporary)
nix-shell -p duaNixOS configuration
environment.systemPackages = [
pkgs.dua
];NetBSD
Via pkgin on your NetBSD system.
pkgin install dua-cliOr, building from source
cd /usr/pkgsrc/sysutils/dua-cli
make installWindows
You will find pre-built binaries for Windows in the releases section.
Alternatively, install via cargo as in
cargo +nightly install dua-clix-cmd
x-cmd is a toolbox for Posix Shell, offering a lightweight package manager built using shell and awk.
x env use dua- Additionally, the
x dua ...command is available, which automatically installsduawithout affecting the environment, such as not modifying thePATHvariable.
Usage
# count the space used in the current working directory
dua
# count the space used in all directories that are not hidden
dua *
# learn about additional functionality
dua aggregate --helpOn macOS, the --deduplicate-apfs-clones traversal option counts fully shared
APFS file clones only once in aggregate and interactive runs. It is opt-in
because collecting the additional metadata reduces traversal performance by
about 6%.
Files that share only some blocks are not deduplicated, and --apparent-size
still reports each file's logical length.
Excluding paths with a pattern file
--ignore-from FILE reads gitignore-style patterns and leaves everything they match out of the
report, in both aggregate and interactive mode. This is the --exclude-from of rsync and the--exclude-file of restic, so the same file can answer "how much of this would actually get
backed up?".
cat .duaignore
# /target/
# **/node_modules/
# *.log
# !important.log
dua --ignore-from .duaignorePatterns follow .gitignore syntax - # comments, a trailing / to match directories only, a
leading / to anchor to the current working directory or the traversal root, ** to span directories,
and ! to re-include something an earlier pattern excluded. They match the paths dua reports,
which are relative to the directory being looked at, and matching is case-sensitive on every platform.
The option can be given more than once, in which case later files win over earlier ones, and it
can also be set through DUA_IGNORE_FROM. Excluded directories are not descended into at all, so
their contents cannot be re-included - the same restriction Git has.
Interactive Mode
Launch into interactive mode with the i or interactive subcommand. Get help on keyboard
shortcuts with ?.
Use this mode to explore, and/or to delete files and directories to release disk space.
Please note that great care has been taken to prevent accidental deletions due to a multi-stage
process, which makes this mode viable for exploration.
dua i
dua interactiveThe help screen can be localized via the standard POSIX locale environment variables, in the
usual order of precedence LC_ALL > LC_MESSAGES > LANG. English is the default; currently
Japanese (ja) is also available when the locale uses UTF-8 or omits the codeset:
LANG=ja_JP.UTF-8 dua i # then press '?' for the Japanese help screenConfiguration
dua can read an optional configuration file from your OS-specific config directory:
- Linux/Unix:
$XDG_CONFIG_HOME/dua-cli/config.toml(or the platform default config dir) - macOS:
~/Library/Application Support/dua-cli/config.toml - Windows:
%APPDATA%\dua-cli\config.toml
If the file is missing, defaults are used.
Currently supported options:
[keys]
# If true, pressing <Esc> in the main pane navigates to the parent directory.
# If true (default), pressing <Esc> in the main pane ascends to the parent directory.
# If false, <Esc> follows the default quit behavior.
esc_navigates_back = trueDevelopment
Please note that all the following assumes a unix system. On Windows, the linux subsystem should do the job.
Run tests
make testsLearn about other targets
makeBut why isβ¦
β¦there only one available backend? `termion` was available previously.
Maintaining both backends seemed more cumbersome than it's worth and add complexity I didn't like anymore. termion had its benefits,
but I never liked that it seems to have dropped out of support.
Thus crossterm is the only remaining backend and it's very actively developed.
Limitations
- Does not show symbolic links at all if no path is provided when invoking
dua- in an effort to skip symbolic links, for now there are pruned and are not used as a root. Symbolic links will be shown if they
are not a traversal root, but will not be followed.
- in an effort to skip symbolic links, for now there are pruned and are not used as a root. Symbolic links will be shown if they
- Interactive mode only looks good in dark terminals (see this issue)
- easy fix: file names in main window are not truncated if too large. They are cut off on the right.
- There are plenty of examples in
tests/fixtureswhich don't render correctly in interactive mode.
This can be due to graphemes not interpreted correctly. With Chinese characters for instance,
column sizes are not correctly computed, leading to certain columns not being shown.
In other cases, the terminal gets things wrong - I use alacritty, and with certain characters it
performs worse than, say iTerm3.
See https://github.com/minimaxir/big-list-of-naughty-strings/blob/master/blns.txt for the source. - In interactive mode, you will need about 60MB of memory for 1 million entries in the graph.
- In interactive mode, the maximum amount of files is limited to 2^32 - 1 (
u32::max_value() - 1) entries.- One node is used as to 'virtual' root
- The actual amount of nodes stored might be lower, as there might be more edges than nodes, which are also limited by a
u32(I guess) - The limitation is imposed by the underlying
petgraphcrate, which declares it asunsafeto use u64 for instance. - It's possibly UB when that limit is reached, however, it was never observed either.
Similar Programs
- CLI:
- TUI:
- GUI:
2. Official Technical Reference & Guides (Byron/docs)
File: README.md
GitButler Documentation
This is the GitButler documentation, which is hosted by Gitbook at docs.gitbutler.com.
Contributing
To contribute to the documentation, you can fork the repository, make your changes and
submit a pull request.
License
The content is under a CC0 public license, so have fun.
File: docs/README.md
π€΅ββοΈ Welcome to GitButler
Overview
GitButler is a new Source Code Management system designed to manage your branches, record and backup your work, be your Git client, help with your code and much more. Our focus is everything after writing code in your editor and before sharing it on GitHub. We're focused on your working directory and how we can help with everything you do there.
Here you will find documentation on the product and the way that we're running our alpha and building our product with your help.
Why We're Doing This
Read about it over Why GitButler Section.
What We Do
Currently GitButler does two things. It records everything in a working directory that you have so that you can rewind to any point in time for any file you have. It also does a growing set of Git operations, soon to be a full fledged Git client. You can read more about these features here: