当前位置: 首页 > Linux

Dutree-Linux命令行磁盘使用分析工具

时间:2023-04-06 03:50:07 Linux

Dutree是Durep和Tree的组合。Durep使用图表创建磁盘使用情况报告,这使我们能够确定哪些目录使用的空间最多。尽管durep可以产生类似du的文本输出,但它的真正强大之处在于能够将报告存储在文件中。Tree是一个目录显示程序,它以树状结构递归地列出终端上的目录。dutree的特点:文件系统彩色输出分层显示用户可以聚合小文件用户可以排除文件或目录用户可以比较不同的目录可靠性和速度系统环境Centos7安装需要先安装cargopackagemanager:[root@localhost~]#yum-yinstallcargo二、配置cargo的仓库地址,因为默认是用国外源,下载速度超慢:进入$HOME/.cargo创建config配置文件:[root@localhost~]#cd$HOME/.cargo[root@localhost.cargo]#touchconfig将以下内容复制到config配置文件中:[source.crates-io]registry="https://github.com/rust-lang/crates.io-index”换成speed为了更快的镜像源,这里使用了上海交通大学的。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社区[source.rustcc]registry="git://crates.rustcc.cn/crates.io-index"Dutree–Linux上的命令行磁盘使用分析工具Dutree–Linux上的命令行磁盘使用分析工具让我们安装dutree:[root@localhost~]#cargoinstalldutreeUpdating`https://mirrors.sjtug.sjtu。edu.cn/git/crates.io-index`indexDownloadeddutreev0.2.16(registryhttps://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载1crate(638.0KB)in0.37s安装dutreev0.2.16下载signal-hookv0.1.16(registryhttps://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载terminal_sizev0.1.13(registryhttps://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载thread_localv1.0.1(注册中心https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载signal-hook-注册表v1.2.2(注册表https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载unicode-widthv0.1.8(注册中心https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载memchrv2.3.4(registryhttps://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载regex-syntaxv0.6.21(registryhttps://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载aho-corasickv0.7.14(注册中心https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载regexv1.4.2(注册中心https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)/mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载libcv0.2.80(注册表https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载lazy_staticv1.4.0(注册中心https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载getoptsv0.2.21(注册中心https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)下载unicode-segmentationv1.6.0(registryhttps://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index)在0.43秒内下载13个crates(1.4MB)编译库cv0.2.80编译memchrv2.3.4编译lazy_staticv1.4.0编译unicode-widthv0.1.8编译regex-syntaxv0.6.21编译unicode-segmentationv1.6.0编译thread_localv1.0.1编译getoptsv0.2.21编译getoptsv0.2.21编译registryv1.2.2编译terminal_sizev0.1.13编译aho-corasickv0.7.14编译signal-hookv0.1.16编译regexv1.4.2编译dutreev0.2.16Finishedrelease[optimized]target(s)in1m35sIncarstaling/root/./bin/dutreeInstalledpackagedutreev0.2.16(executabledutree)warning:besuretoadd/root/.cargo/bintoyourPATHtobeabletoruntheinstalledbinariesDutree–Dutree,命令行磁盘使用分析工具forLinux–Linux上的命令行磁盘使用分析工具看到上面最后一个警告,需要将/root/.cargo/bin目录添加到PATH环境变量中:[root@localhost~]#echo"exportPATH=$PATH:/root/.cargo/bin">>~/.bashrc[root@localhost~]#source~/.bashrcDutree现已可用Dutree-Linux上的命令行磁盘使用分析工具Dutree-Linux行磁盘上的命令使用分析工具实例目录深通使用-d选项并加上数字可以查看一级目录或多层目录。下面是查看/root用户家目录,检查一级目录:[root@localhost~]#dutree-d1./Dutree–onLinux命令行磁盘使用分析工具Dutree–命令行磁盘Linux上的使用分析工具以下是查看/root主目录最多3级目录:[root@localhost~]#dutree-d3./Dutree–Linux上的命令Dutree,一个命令行磁盘使用分析工具Linux。如果不限制目录层数,可以不加-d选项。检查下面的/root/test目录:[root@localhost~]#dutreetest/Dutree-Linux上的命令行磁盘使用分析工具Dutree-Linux上的命令行磁盘使用分析工具Excludeafile要排除的内容匹配一个文件名或目录名,使用下面的-x选项排除dir1的test目录工程中的include:[root@localhost~]#dutree-xdir1test/Dutree–Linux上的命令行磁盘使用分析工具Dutree–Linux命令行磁盘使用分析工具使用-H选项排除隐藏文件:[root@localhost~]#dutree-HDutree–Linux命令行磁盘使用分析工具Dutree–命令行磁盘使用分析Linux上的工具可以看到没有列出隐藏文件。进度条使用ASCII字符显示ASCII字符#可以用来代替默认的进度条:[root@localhost~]#dutree-d1-A/rootDutree–Linux上的命令行磁盘使用分析工具Dutree–LinuxRow上的命令磁盘使用分析工具总结Dutree是Durep和Tree的组合。Durep使用图表创建磁盘使用情况报告,这使我们能够确定哪些目录使用的空间最多。尽管durep可以产生类似du的文本输出,但它的真正强大之处在于能够将报告存储在文件中。Tree是一个目录显示程序,它以树状结构递归地列出终端上的目录。