溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Linux下怎么安裝和使用dust工具

發(fā)布時間:2022-02-14 10:11:54 來源:億速云 閱讀:291 作者:iii 欄目:開發(fā)技術(shù)

這篇文章主要介紹“Linux下怎么安裝和使用dust工具”的相關(guān)知識,小編通過實際案例向大家展示操作過程,操作方法簡單快捷,實用性強,希望這篇“Linux下怎么安裝和使用dust工具”文章能幫助大家解決問題。

dust是一個提供文件類型和元數(shù)據(jù)的工具。如果你在一個目錄中運行了dust,它將以幾種方式報告該目錄的磁盤利用率。它提供了一個信息量很大的圖表,告訴你哪個文件夾使用的磁盤空間最大。如果有嵌套的文件夾,你可以看到每個文件夾使用的空間百分比。

Linux下怎么安裝和使用dust工具

安裝 dust

你可以使用 Rust 的 Cargo 包管理器安裝 dust:

$ cargo install du-dust

另外,你可以在 Linux 上的軟件庫中找到它,在 macOS 上,可以使用 MacPorts 或 Homebrew。

探索 dust

在一個目錄中執(zhí)行 dust 命令,會返回一個圖表,以樹狀格式顯示其內(nèi)容和每個項目所占的百分比。

$ dust
5.7M   ┌── exa                                                           │                                                ██ │   2%
5.9M   ├── tokei                                                         │                                                ██ │   2%
6.1M   ├── dust                                                          │                                                ██ │   2%
6.2M   ├── tldr                                                          │                                                ██ │   2%
9.4M   ├── fd                                                            │                                                ██ │   4%
2.9M   │ ┌── exa                                                         │                                              ???█ │   1%
 15M   │ ├── rustdoc                                                     │                                              ?███ │   6%
 18M   ├─┴ bin                                                           │                                              ████ │   7%
 27M   ├── rg                                                            │                                            ██████ │  11%
1.3M   │     ┌── libz-sys-1.1.3.crate                                    │               ??????????????????????????????????█ │   0%
1.4M   │     ├── libgit2-sys-0.12.19+1.1.0.crate                         │               ??????????????????????????????????█ │   1%
4.5M   │   ┌─┴ github.com-1ecc6299db9ec823                               │               ??????????????????????????????????█ │   2%
4.5M   │ ┌─┴ cache                                                       │               ??????????????????????????????????█ │   2%
1.0M   │ │   ┌── git2-0.13.18                                            │               ?????????????????????????????▓▓▓▓▓█ │   0%
1.4M   │ │   ├── exa-0.10.1                                              │               ?????????????????????????????▓▓▓▓▓█ │   1%
1.5M   │ │   │ ┌── src                                                   │               ?????????????????????????????▓▓▓▓▓█ │   1%
2.2M   │ │   ├─┴ idna-0.2.3                                              │               ?????????????????????????????▓▓▓▓▓█ │   1%
1.2M   │ │   │       ┌── linux                                           │               ?????????????????????????????▓▓▓▓▓█ │   0%
1.6M   │ │   │     ┌─┴ linux_like                                        │               ?????????????????????????????▓▓▓▓▓█ │   1%
2.6M   │ │   │   ┌─┴ unix                                                │               ?????????????????????????????▓▓▓▓▓█ │   1%
3.1M   │ │   │ ┌─┴ src                                                   │               ?????????????????????????????▓▓▓▓▓█ │   1%
3.1M   │ │   ├─┴ libc-0.2.94                                             │               ?????????????????????????????▓▓▓▓▓█ │   1%
1.2M   │ │   │     ┌── test                                              │               ?????????????????????????????▓▓▓▓▓█ │   0%
2.6M   │ │   │   ┌─┴ zlib-ng                                             │               ?????????????????????????????▓▓▓▓▓█ │   1%
904K   │ │   │   │   ┌── vstudio                                         │               ?????????????????????????????▓▓▓▓▓█ │   0%
2.0M   │ │   │   │ ┌─┴ contrib                                           │               ?????????????????????????????▓▓▓▓▓█ │   1%
3.4M   │ │   │   ├─┴ zlib                                                │               ?????????????????????????????▓▓▓▓▓█ │   1%
6.1M   │ │   │ ┌─┴ src                                                   │               ?????????????????????????????▓▓▓▓██ │   2%
6.1M   │ │   ├─┴ libz-sys-1.1.3                                          │               ?????????????????????????????▓▓▓▓██ │   2%
1.6M   │ │   │     ┌── pcre                                              │               ?????????????????????????????▓▓▓▓▓█ │   1%
2.5M   │ │   │   ┌─┴ deps                                                │               ?????????????????????????????▓▓▓▓▓█ │   1%
3.8M   │ │   │   ├── src                                                 │               ?????????????????????????????▓▓▓▓▓█ │   1%
7.4M   │ │   │ ┌─┴ libgit2                                               │               ?????????????????????????????▓▓▓▓██ │   3%
7.6M   │ │   ├─┴ libgit2-sys-0.12.19+1.1.0                               │               ?????????????????????????????▓▓▓▓██ │   3%
 26M   │ │ ┌─┴ github.com-1ecc6299db9ec823                               │               ?????????????????????????????██████ │  10%
 26M   │ ├─┴ src                                                         │               ?????????????????????????????██████ │  10%
932K   │ │   ┌── .cache                                                  │               ??????▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ │   0%
 11M   │ │   │     ┌── pack-c3e3a51a17096a3078196f3f014e02e5da6285aa.idx │               ??????▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓███ │   4%
135M   │ │   │     ├── pack-c3e3a51a17096a3078196f3f014e02e5da6285aa.pack│               ??????▓▓███████████████████████████ │  53%
147M   │ │   │   ┌─┴ pack                                                │               ??????█████████████████████████████ │  57%
147M   │ │   │ ┌─┴ objects                                               │               ??????█████████████████████████████ │  57%
147M   │ │   ├─┴ .git                                                    │               ??????█████████████████████████████ │  57%
147M   │ │ ┌─┴ github.com-1ecc6299db9ec823                               │               ??????█████████████████████████████ │  57%
147M   │ ├─┴ index                                                       │               ??????█████████████████████████████ │  57%
178M   ├─┴ registry                                                      │               ███████████████████████████████████ │  69%
257M ┌─┴ .                                                               │██████████████████████████████████████████████████ │ 100%
$

將 dust 應(yīng)用于一個特定的目錄:

$ dust ~/Work/

Linux下怎么安裝和使用dust工具 

-r 選項以相反的順序顯示輸出,“根”在底部:

$ dust -r ~/Work/

使用 dust -d 3 會返回三層的子目錄和它們的磁盤利用率:

$ dust -d 3 ~/Work/wildfly/jaxrs/target/classes
4.0K     ┌── jaxrs.xml                                                           │                                         █ │   1%
4.0K   ┌─┴ subsystem-templates                                                   │                                         █ │   1%
4.0K   │   ┌── org.jboss.as.controller.transform.ExtensionTransformerRegistration│                                         █ │   1%
4.0K   │   ├── org.jboss.as.controller.Extension                                 │                                         █ │   1%
8.0K   │ ┌─┴ services                                                            │                                         █ │   2%
8.0K   ├─┴ META-INF                                                              │                                         █ │   2%
4.0K   │ ┌── jboss-as-jaxrs_1_0.xsd                                              │                                        ?█ │   1%
8.0K   │ ├── jboss-as-jaxrs_2_0.xsd                                              │                                        ?█ │   2%
 12K   ├─┴ schema                                                                │                                        ██ │   3%
408K   │   ┌── as                                                                │  ████████████████████████████████████████ │  94%
408K   │ ┌─┴ jboss                                                               │  ████████████████████████████████████████ │  94%
408K   ├─┴ org                                                                   │  ████████████████████████████████████████ │  94%
432K ┌─┴ classes                                                                 │██████████████████████████████████████████ │ 100%
$

關(guān)于“Linux下怎么安裝和使用dust工具”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識,可以關(guān)注億速云行業(yè)資訊頻道,小編每天都會為大家更新不同的知識點。

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI