#directory-tree #directory #statistics #cli #command-line-tool

bin+lib treestats

Command-line tool to produce statistics about a directory tree

1 unstable release

0.1.0 Oct 10, 2022

#38 in #directory-tree

Download history 7/week @ 2024-02-24 1/week @ 2024-03-02 1/week @ 2024-03-09 16/week @ 2024-03-30 2/week @ 2024-04-06 42/week @ 2024-04-13

60 downloads per month

ISC license

7KB
90 lines

treestats License

treestats is a simple tool to compute the count and the total size of each file extension in a directory tree.

Usage

Usage: treestats analyze <directory>
       treestats -h | --help
       treestats --version

Commands:
    analyze                  Analyze a directory tree and output statistics.

Arguments:
    directory                Root directory of the directory tree to analyze.

Options:
    -h, --help               Show this screen.
    --version                Show version.

Example

$ treestats analyze ~/Music | sort -nrk3 | head -n 3
  5654 files, 25.19 GiB analyzed [00:00:02]
  ogg     2999    15536178965
  mp3     1922    10386533620
  wma     85      394384068

The output columns are extension, count, total size (in bytes). Files that do not have an extension, or the extension of which is not valid UTF-8 are grouped under “other”.

Compiling

Run cargo build --release in your working copy.

Contributing and reporting bugs

Contributions are welcome through GitHub pull requests.

Please report bugs and feature requests on GitHub issues.

License

treestats is copyright (C) 2022 Jérémie Roquet jroquet@arkanosis.net and licensed under the ISC license.

Dependencies

~5–14MB
~157K SLoC