" 目录:RHCA+ -> 12 系统监控 -> 42 agedu命令(查看磁盘使用情况) "

分析磁盘使用情况,可通过网页显示;语法格式:agedu 参数 目录
license基于MIT协议,免费
|----------------------|--------------------------|
| 参数 | 作用 |
| -s, --scan directory | 扫描目录并生成索引 |
| -w, --web | 根据索引文件,通过临时web服务器生成URL访问 |
| -R, --remove | 删除索引文件 |
| -t, --text subdir | 通过命令行显示纯文本报告 |
| -D, --dump | 将索引文件转储到stdout |
| -L, --load | 加载并索引转储文件 |
| --presort | 准备一个转储文件进行排序 |
| --postsort | 在排序后取消准备转储文件 |
| -S, --scan-dump | 只扫描目录,生成转储 |
| -H, --html subdir | 在子目录上打印HTML报告 |
| --cgi | 从CGI脚本运行 |
|-----------------------------|-------------------------|--------------------|
| 参数 | 适用模式 | 作用 |
| -V | | 查看版本 |
| --help | | 查看帮助 |
| --licence | | 查看licence |
| --auth type | --web | 指定HTTP身份验证方法 |
| --address addr:port | --web | 指定HTTP服务器地址 |
| -f, --file filename | most modes | 指定索引文件 |
| --cross-fs | --scan | 跨文件系统边界 |
| --no-cross-fs | --scan | 只在本文件系统 |
| --prune wildcard | --scan | 删减匹配模式的文件 |
| --prune-path wildcard | --scan | 删减路径名匹配模式 |
| --exclude wildcard | --scan | 排除匹配模式的文件 |
| --exclude-path wildcard | --scan | 排除路径名匹配模式 |
| --include wildcard | --scan | 包含匹配模式的文件 |
| --include-path wildcard | --scan | 包含路径名匹配模式 |
| --progress | --scan | 在stderr上报告进度 |
| --no-progress | --scan | 不报告进度 |
| --tty-progress | --scan | 如果stderr是tty,则报告进度 |
| --dir-atime | --scan,--load | 在目录上保留真实的时间 |
| --no-dir-atime | --scan,--load | 目录上的假时间 |
| --launch shell-cmd | --web | 将基本URL传递给给定的命令 |
| --no-eof | --web | 不要关闭eof上的web服务器 |
| --mtime | --scan | 使用mtime而不是atime |
| --logicalsize | --logicalsize | 使用逻辑文件大小而不是物理文件大小 |
| --files | --web,--html,--text | 列出有效文件 |
| -r, --age-range age-age | --web,--html | 设置颜色编码的限制 |
| -o, --output filename | --html | 指定输出文件或目录名 |
| --numeric | --html | 以数字命名输出文件 |
| --auth-file filename | --web | 从文件读取HTTP基本用户/传递 |
| --auth-fd fd | --web | 从文件读取HTTP基本用户/传递 |
| --title title | --web,--html | 网页标题前缀 |
| -d, --depth levels | --text,--html | 递归级别 |
| -a, --age age | --text | 只包括比此文件早的文件 |
一、安装
root@wuzuniao \~# yum -y install epel-release.noarch #安装epel仓库
root@wuzuniao \~# yum -y install agedu #安装软件
二、使用
root@wuzuniao \~# agedu -V #查看版本
agedu, revision 20200705.2a7d4a2
root@wuzuniao \~# agedu -s / #扫描根目录并生成索引
Built pathname index, 150719 entries, 13767937 bytes of index
Faking directory atimes
Building index
Final index file size = 41853376 bytes
root@wuzuniao \~# ll #查看自动生成的索引文件
-rw-------. 1 root root 41853376 6月 28 22:51 agedu.dat
root@wuzuniao \~# agedu -w #查看索引文件URL
Using Linux /proc/net magic authentication

root@wuzuniao \~# agedu -R #删除索引文件
root@wuzuniao \~# agedu -s /home/ -w --address 192.168.1.160:8080 --auth basic #扫描目录生成索引文件,并指定访问索引文件的临时URL,自动生成账密
Built pathname index, 164 entries, 15197 bytes of index
Faking directory atimes
Building index
Final index file size = 45752 bytes
Username: agedu
Password: 7etut27dnhgryyf9
URL: http://192.168.1.160:8080/


点击目录,可查看子目录占用

root@wuzuniao \~# agedu -t /home/ #通过命令行显示报告
3952 /home/xie
3952 /home
root@wuzuniao \~#