• Stars
    star
    271
  • Rank 151,717 (Top 3 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Highly parallelized, blazing fast directory tree analyzer

Parallel Disk Usage (pdu)

Test Benchmark Clippy Code formatting Crates.io Version

Highly parallelized, blazing fast directory tree analyzer.

Description

pdu is a CLI program that renders a graphical chart for disk usages of files and directories, it is an alternative to dust and dutree.

Benchmark

The benchmark was generated by a GitHub Workflow and uploaded to the release page.

Programs

benchmark results (lower is better)

(See more)

Demo

screenshot

asciicast of pdu command

asciicast of pdu command on /usr

Features

  • Fast.
  • Relative comparison of separate files.
  • Extensible via the library crate or JSON interface.
  • Optional progress report.
  • Customize tree depth.
  • Customize chart size.

Limitations

  • Ignorant of hard links: All hard links are counted as real files.
  • Do not follow symbolic links.
  • Do not differentiate filesystem: Mounted folders are counted as normal folders.
  • The runtime is optimized at the expense of binary size.

Development

Prerequisites

Test

./test.sh && ./test.sh --release
Environment Variables
name type default value description
FMT true or false true Whether to run cargo fmt
LINT true or false true Whether to run cargo clippy
DOC true or false false Whether to run cargo doc
BUILD true or false true Whether to run cargo build
TEST true or false true Whether to run cargo test
BUILD_FLAGS string (empty) Space-separated list of flags for cargo build
TEST_FLAGS string (empty) Space-separated list of flags for cargo test

Run

./run pdu "${arguments[@]}"
  • "${arguments[@]}": List of arguments to pass to pdu.

Build

Debug build

cargo build --bin pdu

The resulting executable is located at target/debug/pdu.

Release build

cargo build --bin pdu --release

The resulting executable is located at target/release/pdu.

Update shell completion files

./generate-completions.sh

Extending parallel-disk-usage

The parallel-disk-usage crate is both a binary crate and a library crate. If you desire features that pdu itself lacks (that is, after you have asked the maintainer(s) of pdu for the features but they refused), you may use the library crate to build a tool of your own. The documentation for the library crate can be found in docs.rs.

Alternatively, the pdu command provides --json-input flag and --json-output flag. The --json-output flag converts disk usage data into JSON and the --json-input flag turns said JSON into visualization. These 2 flags allow integration with other CLI tools (via pipe, as per the UNIX philosophy).

Beware that the structure of the JSON tree differs depends on the number of file/directory names that were provided (as CLI arguments):

  • If there are only 0 or 1 file/directory names, the name of the tree root would be a real path (either . or the provided name).
  • If there are 2 or more file/directory names, the name of the tree root would be (total) (which is not a real path), and the provided names would correspond to the children of the tree root.

Installation

Any Desktop OS

From GitHub

Go to the GitHub Release Page and download a binary.

From crates.io

Prerequisites:

cargo install parallel-disk-usage --bin pdu

Arch Linux

From the Arch User Repository

Prerequisites:

  • An AUR helper, such as paru
paru -S parallel-disk-usage-bin
paru -S parallel-disk-usage

From Khải's Pacman Repository

Follow the installation instruction then run the following command:

sudo pacman -S parallel-disk-usage

Distributions

Packaging Status

Similar programs

License

Apache 2.0 © Hoàng Văn Khải.

More Repositories

1

github-actions-deploy-aur

GitHub Actions to publish AUR package
Shell
90
star
2

pipe-trait

Make it possible to chain regular functions
Rust
29
star
3

deno-args

Extensible CLI arguments parser for Deno with intelligent TypeScript inference
TypeScript
25
star
4

build-fs-tree

Generate a filesystem tree from a macro or a YAML tree
Rust
15
star
5

zero-copy-pads

Padding/aligning values without heap allocation
Rust
5
star
6

strip-ansi-cli

Strip ANSI escape sequences from text
Shell
4
star
7

deno-compose

pipe, pipeline, and compose functions with 64 overloads per function.
TypeScript
4
star
8

khai-powerlevel9k-config

Khải's own powerlevel9k powerline configuration
Shell
4
star
9

aur-packages-builder

Periodically build packages from the Arch User Repository and publish them to my personal pacman repo
Nu
4
star
10

yaml-wasm

WebAssembly module to parse YAML
JavaScript
3
star
11

deno-tree

Deno's library to traverse filesystem tree.
TypeScript
2
star
12

ibus-daemon.pkgbuild

SystemD user service for IBus
Shell
2
star
13

rounded-div

Get rounded result of an integer division
Rust
2
star
14

deno_run_tests_on_localhost

Create a localhost server and run tests
TypeScript
2
star
15

GPL-3.0

GNU General Public License v3.0
2
star
16

pacman-repo

Repository of Arch Linux packages for my personal use
2
star
17

fmt-iter

Print all items from an iterator
Rust
2
star
18

add-two-number-strings

Little function calculate sum of big numbers
JavaScript
1
star
19

text-block-macros

Create a multiline string literal
Rust
1
star
20

clap-utilities

Small utilities related to clap
Rust
1
star
21

rust-alpm-playground

Rust
1
star
22

simple-js-yaml-port-for-deno

This is a simple and crude port of JS-YAML for Deno.
JavaScript
1
star
23

id3-cli

View and modify IDv3 tags
Rust
1
star
24

pretty-exec

Print a command and then execute it
Rust
1
star
25

egg-shell

The Egg Shell Scripting Language
Rust
1
star
26

parallel-disk-usage-0.2.4-benchmarks

Benchmark of Parallel Disk Usage (pdu) v0.2.4 againsts dust, dutree, dua, ncdu, gdu, and du
1
star
27

get-type-info-without-checking

1
star
28

joplin-appimg.pkgbuild

PKGBUILD to install AppImage from Joplin (https://github.com/laurent22/joplin)
Shell
1
star
29

deno-once

Create a function that calls and cache a function once
TypeScript
1
star
30

crow-translate-bin.pkgbuild

Shell
1
star
31

distinct-float.archive

Some code that may or may not be useful in the future
Rust
1
star
32

derive-more-error-bug-generic

Bug Report: Error doesn't work with generic
Rust
1
star
33

tap-trait

Inspect and mutate values without leaving the method chain
Rust
1
star
34

deno_simple_static_server

Simple stoppable static file server for testing purposes
TypeScript
1
star
35

personal-pacman-packages

My personal collection of PKGBUILDs
Shell
1
star