Coder Social home page Coder Social logo

peret / parallel-disk-usage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ksxgithub/parallel-disk-usage

0.0 1.0 0.0 897 KB

Highly parallelized, blazing fast directory tree analyzer

Home Page: https://crates.io/crates/parallel-disk-usage

License: Apache License 2.0

Shell 3.62% Python 1.50% Rust 85.25% PowerShell 1.19% TypeScript 7.85% Elvish 0.59%

parallel-disk-usage's Introduction

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.

Prerequisites:

cargo install parallel-disk-usage --bin pdu

Arch Linux

Prerequisites:

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

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.

parallel-disk-usage's People

Contributors

ksxgithub avatar dependabot[bot] avatar renovate-bot avatar byron avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.