If you work on the Linux command line, you’ll be familiar with the du command. Knowing commands like du can quickly return information about disk usage, which is one of the more efficient ways for command-line programmers. However, if you’re looking for a way to save more time and make your life easier, take a look at dust, which is du rewritten in Rust and has a much more intuitive feel.

In short, DUST is a tool that provides file types and metadata. If you trigger DUST in a directory, it will report disk utilization for that directory in several ways. It provides a very informative chart showing which folders are using the most disk space. If you have a nested folder, you can see the percentage of space used by each folder.

The installation of dust

You can install Dust using Rust’s Cargo package manager.

$ cargo install du-dust

Alternatively, you can find it in the software library on Linux, on macOS, using MacPorts or Homebrew.

To explore the dust

Issuing the dust command on a directory returns a chart showing its contents and the percentage of each item in a tree format.

$5.7 M dust ┌ ─ ─ exa │ █ █ │ 2% 5.9 M ├ ─ ─ tokei │ █ █ │ 2% 6.1 M ├ ─ ─ dust │ █ █ │ 2% 6.2 M ├ ─ ─ TLDR │ █ █ │ 2% 9.4 M ├ ─ ─ fd │ █ █ │ │ 4% 2.9 M ┌ ─ ─ exa │ ░ ░ ░ █ 15 M │ │ 1% ├ ─ ─ rustdoc │ ░ █ █ █ │ 6% 18 M ├ ─ ┴ bin │ █ █ █ █ │ 7% 27 M ├ ─ ─ rg │ █ █ █ █ █ █ │ │ 11% 1.3 M ┌ ─ ─ libz - sys - 1.1.3. Crate │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ █ │ │ 0% 1.4 M ├ ─ ─ libgit2 - sys - 0.12.19 + 1.1.0. Crate │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ █ │ │ 1% 4.5 M ┌ ─ ┴ github.com - 1 ecc6299db9ec823 │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ █ │ 2% of 4.5 M │ ┌ ─ ┴ cache │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ █ 2% 1.0 M │ │ │ ┌ ─ ─ git2-0.13.18 │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 0% 1.4 M │ │ │ ├ ─ ─ exa - 0.10.1 │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 1% 1.5 M │ │ │ │ ┌ ─ ─ the SRC │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 1% 2.2 M │ │ │ ├ ─ ┴ idna - 0.2.3 │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ │ 1% 1.2 M │ │ │ ┌ ─ ─ Linux │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 0% 1.6 M │ │ │ │ ┌ ─ ┴ linux_like │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 1% 2.6 M │ │ │ │ ┌ ─ ┴ Unix │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 1% 3.1 M │ │ │ │ ┌ ─ ┴ The SRC │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 1% 3.1 M │ │ │ ├ ─ ┴ libc - 0.2.94 │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ │ 1% to 1.2 M │ │ │ ┌ ─ ─ the test │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 0% 2.6 M │ │ │ │ ┌ ─ ┴ zlib - ng │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ │ 1% of 904 k │ │ │ │ ┌ ─ ─ vstudio │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 0% 2.0 M │ │ │ │ │ ┌ ─ ┴ contrib │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 1% 3.4 M │ │ │ │ ├ ─ ┴ zlib │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 1% 6.1 M │ │ │ │ ┌ ─ ┴ The SRC │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ █ █ 2% 6.1 M │ │ │ ├ ─ ┴ libz sys - 1.1.3 │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ █ █ │ 2% 1.6 M │ │ │ ┌ ─ ─ pcre │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 1% 2.5 M │ │ │ │ ┌ ─ ┴ deps │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 1% 3.8 M │ │ │ │ ├ ─ ─ the SRC │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ █ 1% 7.4 M │ │ │ │ ┌ ─ ┴ libgit2 │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ █ █ 3% 7.6 M │ │ │ ├ ─ ┴ libgit2 sys - 0.12.19 + 1.1.0 │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ █ █ │ 3% 26 m │ │ ┌ ─ ┴ github.com - 1 ecc6299db9ec823 │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ █ █ █ █ █ █ 10% 26 m │ │ ├ ─ ┴ SRC │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ █ █ █ █ █ █ 10% 932 k │ │ │ ┌ ─ ─ the cache │ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ 0% 11 m │ │ │ │ ┌ ─ ─ Pack - c3e3a51a17096a3078196f3f014e02e5da6285aa. Independence idx │ ░ ░ ░ ░ ░ ░ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ █ █ 4% 135 m │ │ │ │ ├ ─ ─ Pack - c3e3a51a17096a3078196f3f014e02e5da6285aa. Pack │ ░ ░ ░ ░ ░ ░ ▓ ▓ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ 53% 147 m │ │ │ │ ┌ ─ ┴ pack │ ░ ░ ░ ░ ░ ░ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ 57% 147 m │ │ │ │ ┌ ─ ┴ objects │ ░ ░ ░ ░ ░ ░ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ 57% 147 m │ │ │ ├ ─ ┴. Git │ ░ ░ ░ ░ ░ ░ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ 57% 147 m │ │ │ ┌ ─ ┴ github.com - 1 ecc6299db9ec823 │ ░ ░ ░ ░ ░ ░ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ │ │ 57% 147 m ├ ─ ┴ index │ ░ ░ ░ ░ ░ ░ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ │ 57% 178 m ├ ─ ┴ registry │ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ │ 69% 257 m ┌ ─ ┴. │ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ │ $100%Copy the code

Put dust into a specific directory.

$ dust ~/Work/

The -r option displays the output in reverse order, with the root at the bottom.

$ dust -r ~/Work/

With dust -d 3, three levels of subdirectories and their disk utilization are returned.

$ dust -d 3 ~/Work/wildfly/jaxrs/target/classes

$dust - 3 d ~ / Work/wildfly/jaxrs/target/classes 4.0 K ┌ ─ ─ jaxrs. XML │ █ │ 1% 4.0 K ┌ ─ ┴ subsystem - templates │ █ │ │ 1% 4.0 K ┌ ─ ─ org. Jboss. As the controller. The transform. The ExtensionTransformerRegistration │ █ │ │ 1% 4.0 K ├ ─ ─ Org. Jboss. As the controller, the Extension │ █ │ │ 1% 8.0 K ┌ ─ ┴ services │ █ │ 2% 8.0 K ├ ─ ┴ meta-inf │ █ │ │ 2% 4.0 K ┌ ─ ─ Jboss - as - jaxrs_1_0. XSD │ ░ █ │ │ 1% 8.0 K ├ ─ ─ jboss - as - jaxrs_2_0. XSD │ ░ █ │ 2% 12 K ├ ─ ┴ schema │ █ █ 3% 408 K │ │ ┌ ─ ─ as │ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ │ │ 94% 408 k ┌ ─ ┴ jboss │ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ │ 94% 408 k ├ ─ ┴ org │ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ │ 94% 432 k ┌ ─ ┴ classes │ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ │ 100% of the $Copy the code

conclusion

The advantage of DUST is that it is a small, simple, easy-to-understand command. It uses a color scheme to represent the largest subdirectories, making your directories easy to visualize. This is a popular project and everyone is welcome to contribute.

Do you use or consider using DUST? If so, let us know what you think in the comments below.