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

一、Agedu工具介绍

  • Agedu是一个用于分析磁盘空间使用情况的工具,它可以扫描文件系统并生成一个报告,该报告按大小排序列出所有文件和目录。

  • Agedu可以让用户轻松地识别哪些文件和目录占用了最多的磁盘空间,帮助用户做出决策,例如删除不必要的文件或将大文件移动到另一个磁盘。

  • Agedu可以在Linux和其他Unix操作系统上运行,并支持多种文件系统类型。

二、本次实践环境介绍

1.1 本地环境规划

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

hostnameIP地址操作系统版本内核版本
jeven192.168.3.166centos 7.63.10.0-957.el7.x86_64

1.2 检查操作系统版本

检查本地操作系统版本

[root@jeven ~]# cat /etc/system-release
CentOS Linux release 7.6.1810 (Core)

三、安装epel源

3.1 安装epel源

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

wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo

3.2 检查yum仓库状态

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

[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工具

yum install -y agedu

在这里插入图片描述

4.2 查看Agedu工具版本

查看Agedu工具版本

[root@jeven ~]# agedu -V
agedu, revision 20200705.2a7d4a2

五、Agedu工具的基本使用

5.1 agedu命令帮助

查看agedu命令的help帮助

[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

[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
[root@jeven ~]# agedu -w
Using Linux /proc/net magic authentication
URL: http://localhost:51322/

5.4 在终端打印报告

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

[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 ,生成网页报告。

agedu -s /home/ -w --address 192.168.3.166:8990  --auth basic

在这里插入图片描述

  • 输入打印出的账号和密码,打开网页报告。

在这里插入图片描述

在这里插入图片描述

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
磁盘分区是将一个物理磁盘划分为多个逻辑分区,以便于存储和管理数据。在Linux系统中,磁盘分区可以使用多种工具进行管理,包括fdisk、cfdisk、parted等。下面简单介绍一下这些工具使用。 1. fdisk fdisk是Linux系统中最常用的磁盘分区管理工具之一。使用fdisk可以对磁盘进行分区、删除分区、查看分区等操作。例如,要对/dev/sda进行分区操作,可以使用以下命令: ``` fdisk /dev/sda ``` 进入fdisk交互界面后,可以使用m命令查看所有可用的命令,使用n命令创建新分区,使用d命令删除分区,使用w命令保存并退出。 2. cfdisk cfdisk是fdisk的简化版,使用其可以更加方便地进行磁盘分区管理。使用cfdisk对/dev/sda进行分区,可以使用以下命令: ``` cfdisk /dev/sda ``` cfdisk界面中可以使用箭头键来选择不同的选项,使用Enter键进行确认。使用n命令创建新分区,使用d命令删除分区,使用w命令保存并退出。 3. parted parted是Linux系统中另一个常用的磁盘分区管理工具使用其可以对磁盘进行更加灵活的分区操作。例如,要对/dev/sda进行分区操作,可以使用以下命令: ``` parted /dev/sda ``` 进入parted交互界面后,可以使用p命令查看分区表,使用mkpart命令创建新分区,使用rm命令删除分区,使用quit命令保存并退出。 以上是几种常用的Linux磁盘分区管理工具使用方法,通过这些工具,可以对磁盘进行分区、删除分区、查看分区等操作,以满足不同的存储需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

江湖有缘

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值