前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Linux系统之Agedu工具的基本使用

Linux系统之Agedu工具的基本使用

原创
作者头像
江湖有缘
发布2023-09-21 21:51:31
2370
发布2023-09-21 21:51:31
举报
文章被收录于专栏:Linux成长之路Linux成长之路

一、Agedu工具介绍

  • Agedu是一个用于分析磁盘空间使用情况的工具,它可以扫描文件系统并生成一个报告,该报告按大小排序列出所有文件和目录。
  • Agedu可以让用户轻松地识别哪些文件和目录占用了最多的磁盘空间,帮助用户做出决策,例如删除不必要的文件或将大文件移动到另一个磁盘。
  • Agedu可以在Linux和其他Unix操作系统上运行,并支持多种文件系统类型。

二、本次实践环境介绍

1.1 本地环境规划

本次实践为个人测试环境,操作系统版本为centos7.6。

hostname

IP地址

操作系统版本

内核版本

jeven

192.168.3.166

centos 7.6

3.10.0-957.el7.x86_64

1.2 检查操作系统版本

检查本地操作系统版本

代码语言:shell
复制
[root@jeven ~]# cat /etc/system-release
CentOS Linux release 7.6.1810 (Core)

三、安装epel源

3.1 安装epel源

使用阿里的epel源,配置yum仓库。

代码语言:shell
复制
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo

3.2 检查yum仓库状态

检查yum仓库状态,查看各镜像源的状态。

代码语言:shell
复制
[root@jeven ~]# cat /etc/system-release
CentOS Linux release 7.6.1810 (Core) 
[root@jeven ~]# yum repolist all |grep enable 
!base/7/x86_64        CentOS-7 - Base - mirrors.aliyun.com       enabled: 10,072
!epel/x86_64          Extra Packages for Enterprise Linux 7 - x8 enabled: 13,753
!extras/7/x86_64      CentOS-7 - Extras - mirrors.aliyun.com     enabled:    515
!updates/7/x86_64     CentOS-7 - Updates - mirrors.aliyun.com    enabled:  5,053

四、安装Agedu工具

4.1 安装Agedu

使用yum直接安装Agedu工具

代码语言:shell
复制
yum install -y agedu
在这里插入图片描述
在这里插入图片描述

4.2 查看Agedu工具版本

查看Agedu工具版本

代码语言:shell
复制
[root@jeven ~]# agedu -V
agedu, revision 20200705.2a7d4a2

五、Agedu工具的基本使用

5.1 agedu命令帮助

查看agedu命令的help帮助

代码语言:shell
复制
[root@jeven ~]# agedu --help
  usage: agedu [options] action [action...]
actions: -s, --scan directory    scan and index a directory
         -w, --web               serve HTML reports from a temporary web server
         -t, --text subdir       print a plain text report on a subdirectory
         -R, --remove            remove the index file
         -D, --dump              dump the index file on stdout
         -L, --load              load and index a dump file
         --presort               prepare a dump file for sorting
         --postsort              unprepare a dump file after sorting
         -S, --scan-dump directory scan only, generating a dump
         -H, --html subdir       print an HTML report on a subdirectory
         --cgi                   do the right thing when run from a CGI script
options: -f, --file filename     [most modes] specify index file
         --cross-fs              [--scan] cross filesystem boundaries
         --no-cross-fs           [--scan] stick to one filesystem
         --prune wildcard        [--scan] prune files matching pattern
         --prune-path wildcard   [--scan] prune pathnames matching pattern
         --exclude wildcard      [--scan] exclude files matching pattern
         --exclude-path wildcard [--scan] exclude pathnames matching pattern
         --include wildcard      [--scan] include files matching pattern
         --include-path wildcard [--scan] include pathnames matching pattern
         --progress              [--scan] report progress on stderr
         --no-progress           [--scan] do not report progress
         --tty-progress          [--scan] report progress if stderr is a tty
         --dir-atime             [--scan,--load] keep real atimes on directories
         --no-dir-atime          [--scan,--load] fake atimes on directories
         --launch shell-cmd      [--web] pass the base URL to the given command
         --no-eof                [--web] do not close web server on EOF
         --mtime                 [--scan] use mtime instead of atime
         --logicalsize           [--logicalsize] use logical instead of physical file size
         --files                 [--web,--html,--text] list individual files
         -r, --age-range age[-age] [--web,--html] set limits of colour coding
         -o, --output filename   [--html] specify output file or directory name
         --numeric               [--html] name output files numerically
         --address addr[:port]   [--web] specify HTTP server address
         --auth type             [--web] specify HTTP authentication method
         --auth-file filename    [--web] read HTTP Basic user/pass from file
         --auth-fd fd            [--web] read HTTP Basic user/pass from fd
         --title title           [--web,--html] title prefix for web pages
         -d, --depth levels      [--text,--html] recurse to this many levels
         -a, --age age           [--text] include only files older than this
   also: -h, --help              display this help text
         -V, --version           report version number
         --licence               display (MIT) licence text

5.2 指定扫描目录

指定扫描家目录为/home/admin

代码语言:shell
复制
[root@jeven ~]# agedu -s /home/admin
Built pathname index, 167 entries, 15443 bytes of index                                                                                               
Faking directory atimes
Building index
Final index file size = 45024 bytes

5.3 生成网页报告URL

  • 生成网页报告URL
代码语言:shell
复制
[root@jeven ~]# agedu -w
Using Linux /proc/net magic authentication
URL: http://localhost:51322/

5.4 在终端打印报告

直接在Linux终端打印目录/home/admin的扫描报告。

代码语言:shell
复制
[root@jeven ~]# agedu -t /home/admin
4932        /home/admin/.cache
76          /home/admin/.config
4           /home/admin/.dbus
304         /home/admin/.local
20          /home/admin/.vnc
5368        /home/admin

5.5 指定地址生成网页报告

可以使用以下命令,对/home目录扫描,指定地址为192.168.3.166:8990 ,生成网页报告。

代码语言:shell
复制
agedu -s /home/ -w --address 192.168.3.166:8990  --auth basic
在这里插入图片描述
在这里插入图片描述
  • 输入打印出的账号和密码,打开网页报告。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

我正在参与2023腾讯技术创作特训营第二期有奖征文,瓜分万元奖池和键盘手表

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一、Agedu工具介绍
  • 二、本次实践环境介绍
    • 1.1 本地环境规划
      • 1.2 检查操作系统版本
      • 三、安装epel源
        • 3.1 安装epel源
          • 3.2 检查yum仓库状态
          • 四、安装Agedu工具
            • 4.1 安装Agedu
              • 4.2 查看Agedu工具版本
              • 五、Agedu工具的基本使用
                • 5.1 agedu命令帮助
                  • 5.2 指定扫描目录
                    • 5.3 生成网页报告URL
                      • 5.4 在终端打印报告
                        • 5.5 指定地址生成网页报告
                        领券
                        问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
                        http://www.vxiaotou.com