日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網營銷解決方案
Linux中使用Dutree分析磁盤使用情況

Dutree是Durep和Tree的組合。Durep用圖表創(chuàng)建磁盤使用情況報告,這使我們能夠確定哪些目錄使用了最多的空間。盡管durep可以產生類似于du的文本輸出,但其真正的功能是能夠將報告存儲在文件中。Tree是目錄顯示程序,它以樹狀結構在終端上遞歸列出目錄。

成都創(chuàng)新互聯(lián)公司2013年開創(chuàng)至今,先為民勤等服務建站,民勤等地企業(yè),進行企業(yè)商務咨詢服務。為民勤企業(yè)網站制作PC+手機+微官網三網同步一站式服務解決您的所有建站問題。

系統(tǒng)環(huán)境

Centos7

安裝

需要先安裝cargo包管理器:

[root@localhost ~]# yum -y install cargo

其次配置cargo的倉庫地址,因為默認使用國外源,下載速度超慢:

進入$HOME/.cargo創(chuàng)建config配置文件:

[root@localhost ~]# cd $HOME/.cargo
[root@localhost .cargo]# touch config

將下面內容復制到config配置文件中:

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"

# 替換成速度比較快的鏡像源,這里使用上海交大的。
replace-with = 'sjtu'

# 清華大學
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"

# 上海交通大學
[source.sjtu]
registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"

# rustcc社區(qū)
[source.rustcc]
registry = "git://crates.rustcc.cn/crates.io-index"

開始安裝dutree吧:

[root@localhost ~]# cargo install dutree
   Updating `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index` index
 Downloaded dutree v0.2.16 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded 1 crate (638.0 KB) in 0.37s
 Installing dutree v0.2.16
 Downloaded signal-hook v0.1.16 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded terminal_size v0.1.13 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded thread_local v1.0.1 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded signal-hook-registry v1.2.2 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded unicode-width v0.1.8 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded memchr v2.3.4 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded regex-syntax v0.6.21 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded aho-corasick v0.7.14 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded regex v1.4.2 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded libc v0.2.80 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded lazy_static v1.4.0 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded getopts v0.2.21 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded unicode-segmentation v1.6.0 (registry `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index`)
 Downloaded 13 crates (1.4 MB) in 0.43s
  Compiling libc v0.2.80
  Compiling memchr v2.3.4
  Compiling lazy_static v1.4.0
  Compiling unicode-width v0.1.8
  Compiling regex-syntax v0.6.21
  Compiling unicode-segmentation v1.6.0
  Compiling thread_local v1.0.1
  Compiling getopts v0.2.21
  Compiling signal-hook-registry v1.2.2
  Compiling terminal_size v0.1.13
  Compiling aho-corasick v0.7.14
  Compiling signal-hook v0.1.16
  Compiling regex v1.4.2
  Compiling dutree v0.2.16
   Finished release [optimized] target(s) in 1m 35s
 Installing /root/.cargo/bin/dutree
  Installed package `dutree v0.2.16` (executable `dutree`)
warning: be sure to add `/root/.cargo/bin` to your PATH to be able to run the installed binaries

看到上面最后一個warning提示,需要將/root/.cargo/bin目錄添加到PATH環(huán)境變量中:

[root@localhost ~]# echo "export PATH=$PATH:/root/.cargo/bin" >> ~/.bashrc
[root@localhost ~]# source ~/.bashrc

現在可以使用dutree了

實例

目錄深度

通過-d選項,加上數字,查看一層目錄或者多層目錄,下面是查看/root用戶家目錄的,查查看一層目錄:

[root@localhost ~]# dutree -d1 ./

下面是查看/root家目錄最多3層目錄:

[root@localhost ~]# dutree -d3 ./

如果不限制目錄層數,可以不加-d選項,下面查看/root/test目錄:

[root@localhost ~]# dutree test/

排除某個文件

要排除與文件或目錄名稱匹配的內容,請使用-x選項。下面排除test目錄中包括dir1的項目:

[root@localhost ~]# dutree -x dir1 test/

使用-H選項,可以排除隱藏文件:

[root@localhost ~]# dutree -H

可以看到隱藏文件沒有列出來。

進度條使用ASCII字符顯示

可以使用ASCII字符#號來代替默認的進度條:

[root@localhost ~]# dutree -d1 -A /root

總結

Dutree是Durep和Tree的組合。Durep用圖表創(chuàng)建磁盤使用情況報告,這使我們能夠確定哪些目錄使用了最多的空間。盡管durep可以產生類似于du的文本輸出,但其真正的功能是能夠將報告存儲在文件中。Tree是目錄顯示程序,它以樹狀結構在終端上遞歸列出目錄。


本文標題:Linux中使用Dutree分析磁盤使用情況
轉載來源:http://www.5511xx.com/article/ccdeheh.html