Skip to content

melak47/treesize-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

42 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

treesize

crate.badge license.badge commits.badge

CI status: build.badge

treesize is a small command-line utility for listing a directory tree sorted by size. It's main goal is to quickly provide an overview of what is taking up the most space in a tree, so by default it will only list the 5 largest entries in the specified directory (and summarize the rest):

> treesize
.               99.4  MiB  (Ξ£)
β”œβ”€β”€ target      99.4  MiB  (Ξ£)
β”œβ”€β”€ src         13.4  KiB  (Ξ£)
β”œβ”€β”€ Cargo.lock  4.9   KiB
β”œβ”€β”€ README.md   3.2   KiB
β”œβ”€β”€ LICENSE     1.1   KiB
└── ...         271   B    (Ξ£)

You can use these options to tweak the output listing (traversal of the tree is not affected):

-d <max-depth>          Maximal directory depth to recurse, or -1 for infinite [default: 0]
-e <max-entries>        Maximum number of entries to display per directory, or -1 for infinite [default: 5]
-s <size-format>        How to format node sizes: h/human – powers of 1024, H/si – powers of 1000, r/raw – no
                        folding [default: human]

For example:

> treesize -d2 -e3
.                          99.4   MiB  (Ξ£)
β”œβ”€β”€ target                 99.4   MiB  (Ξ£)
β”‚   β”œβ”€β”€ debug              75.4   MiB  (Ξ£)
β”‚   β”‚   β”œβ”€β”€ deps           53.4   MiB  (Ξ£)
β”‚   β”‚   β”œβ”€β”€ treesize.pdb   10.1   MiB
β”‚   β”‚   β”œβ”€β”€ build          5.0    MiB  (Ξ£)
β”‚   β”‚   └── ...            6.9    MiB  (Ξ£)
β”‚   └── release            24.0   MiB  (Ξ£)
β”‚       β”œβ”€β”€ deps           18.0   MiB  (Ξ£)
β”‚       β”œβ”€β”€ build          3.6    MiB  (Ξ£)
β”‚       β”œβ”€β”€ treesize.pdb   1.6    MiB
β”‚       └── ...            756.7  KiB  (Ξ£)
β”œβ”€β”€ src                    13.4   KiB  (Ξ£)
β”‚   β”œβ”€β”€ directory          9.4    KiB  (Ξ£)
β”‚   β”‚   β”œβ”€β”€ print.rs       4.0    KiB
β”‚   β”‚   β”œβ”€β”€ mod.rs         2.6    KiB
β”‚   β”‚   β”œβ”€β”€ filesystem.rs  1.6    KiB
β”‚   β”‚   └── ...            1.2    KiB  (Ξ£)
β”‚   └── main.rs            4.0    KiB
β”œβ”€β”€ Cargo.lock             4.9    KiB
└── ...                    4.5    KiB  (Ξ£)

Flags that affect the traversal include:

-a                   List all files (including dotfiles)
-L                   Follow any symbolic links encountered
--one-file-system    Stay in the same file system when listing

About

List directory tree, sorted by size

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages