Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Highly parallelized, blazing fast directory tree analyzer

License

NotificationsYou must be signed in to change notification settings

KSXGitHub/parallel-disk-usage

 
 

Repository files navigation

TestBenchmarkClippyCode formattingCrates.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 todust anddutree.

Benchmark

The benchmark was generated bya 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
nametypedefault valuedescription
FMTtrue orfalsetrueWhether to runcargo fmt
LINTtrue orfalsetrueWhether to runcargo clippy
DOCtrue orfalsefalseWhether to runcargo doc
BUILDtrue orfalsetrueWhether to runcargo build
TESTtrue orfalsetrueWhether to runcargo test
BUILD_FLAGSstring(empty)Space-separated list of flags forcargo build
TEST_FLAGSstring(empty)Space-separated list of flags forcargo test

Run

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

Build

Debug build

cargo build --bin pdu

The resulting executable is located attarget/debug/pdu.

Release build

cargo build --bin pdu --release

The resulting executable is located attarget/release/pdu.

Update shell completion files

./generate-completions.sh

Extendingparallel-disk-usage

Theparallel-disk-usage crate is both a binary crate and a library crate. If you desire features thatpdu itself lacks (that is, after you have asked the maintainer(s) ofpdu 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 indocs.rs.

Alternatively, thepdu 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 theGitHub Release Page and download a binary.

Prerequisites:

cargo install parallel-disk-usage --bin pdu

Arch Linux

sudo pacman -S parallel-disk-usage

Distributions

Packaging Status

Similar programs

License

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


[8]ページ先頭

©2009-2025 Movatter.jp