Tracking Down Wasted Disk Space in Linux using Agedu


If you’re a Linux user, managing disk space is essential to system maintenance. However, identifying the files and directories that are taking up larger amounts of space can be a stressful task. That's where Agedu comes in. Agedu is an important tool that can help you track down wasted disk space on your Linux system.

In this article, you’ll be informed through installing and using Agedu to identify the directories and files that are taking up the most space on your Linux system. By the end of this article, you will be able to optimize your disk space by removing unnecessary files and directories, which can improve the performance and reliability of your Linux system.

Agedu, which is pronounced as "age dee you," is a free and open-source utility that serves a similar purpose as the "du" command. With Agedu, system administrators can easily locate old files that are consuming significant disk space and decide whether to delete or move them to free up space on their systems. In other words, Agedu is a valuable tool for tracking down and managing wasted disk space on Linux systems.

Features of Agedu

Agedu is a simple, yet powerful tool that can help you identify wasted disk space on your Linux system. Some of the features of Agedu include −

  • Ability to scan multiple directories

  • Sorting of directories by size

  • Display of the percentage of total disk space used by each directory

  • Option to exclude certain directories from the scan

How does Agedu Work?

Agedu works by scanning the directories you specify and creating a list of files and directories sorted by their size. It then calculates the percentage of total disk space used by each directory and displays this information in an easily understandable format. Essentially, it helps you visualize which files or directories are taking up the most space on your system. By knowing which files or directories are consuming the most disk space, you can make informed decisions on what to delete or move to free up disk space. With Agedu, it becomes effortless to pinpoint which directories or files are taking up the most space on your system.

How to Install Agedu in Linux Systems?

Installing Agedu in Linux is a very straightforward process. Here's how to do it −

Step 1

To begin, launch the terminal and update your current package list by executing the following command 

sudo apt-get update

Here is the terminal output 

Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Fetched 329 kB in 1s (366 kB/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

Step 2

To install Agedu, simply execute the command below −

sudo apt-get install agedu

Here is the terminal output 

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libc6-i386 libexpat1-dev libexpat1-dev:i386 libexpat1:i386 libgomp1:i386 libklibc:i386 libkmod2:i386 liblzma5:i386 libpcre16-3:i386 libpcre3-dev libpcre3-dev:i386 libpcre3:i386 libpcre32-3:i386
  libpcrecpp0v5:i386 libsepol1:i386 libsystemd0:i386 libtasn1-6:i386 libtasn1-6-dev:i386 libtasn1-doc:i386 libtasn1-modules:i386 libzstd1:i386
Suggested packages:
  klibc-utils:i386 systemd-container:i386
The following NEW packages will be installed:
  agedu libc6-i386 libexpat1-dev libexpat1-dev:i386 libexpat1:i386 libgomp1:i386 libklibc:i386 libkmod2:i386 liblzma5:i386 libpcre16-3:i386 libpcre3-dev libpcre3-dev:i386 libpcre3:i386
  libpcre32-3:i386 libpcrecpp0v5:i386 libsepol1:i386 libsystemd0:i386 libtasn1-6:i386 libtasn1-6-dev:i386 libtasn1-doc:i386 libtasn1-modules:i386 libzstd1:i386
0 upgraded, 22 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,860 kB of archives.
After this operation, 33.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

Tracking Wasted Disk Space in Linux with Agedu

Now that Agedu is successfully installed, let's take a look at how we can use this tool to track down any wasted disk space on our Linux system.

Step 1

To scan a specific directory, start by opening the terminal and navigating to the desired location. For instance, if you want to scan the home directory, enter the following command in the terminal 

cd ~

Here is an example of the output 

user@hostname:~$

Step 2

To scan a specific directory using Agedu, simply run the following command 

agedu -s .

Here is an example of the output 

/root/.agedu/agedu.dat: created: 2023-02-27 10:42:47, modified: 2023-02-27 10:42:47, size: 179B

/scanned/directory/path                                 Total used in directory
========================================================= ====================
.                                                      2.8 GiB 100.0% ********
├── folder1                                           1.5 GiB  53.4% ******
├── folder2                                           830 MiB  29.4% ****
├── file1                                             300 MiB  10.7% **
└── file2                                              92 MiB   3.3% *

By using the -s option with Agedu, you can limit the scanning process to only the current directory (.), rather than scanning the entire file system. If you want to scan a specific directory, you can replace the "." with the path of that directory.

Step 3

Once Agedu has finished scanning the directory, it will generate a report in HTML format. For viewing the report run the given command 

agedu -w report.html .

Here is an example of the output 

$ agedu -w report.html .
Scanning directory .: 12.1 GiB (11930025950 bytes) in 83461 files and 11154 directories.
Scanning complete: 731.812 seconds elapsed

After running the command "agedu -w report.html" in the terminal, Agedu will generate an HTML report and save it as a file named "report.html" in the same directory. To view the report, you can simply open the file in your web browser.

The report generated by Agedu will list directories in descending order of their size, along with the percentage of total disk space occupied by each directory. This way, you can easily identify which directories are taking up the most space on your system and take necessary actions to free up some space.

For example, here's a sample output of Agedu report for the home directory 

Directory                           Bytes  Files  Inode   %du    %dp   %of
-------------------------------------------------------------------------
/home/user                          15.0G  14399   1672 100.0  28.2%  87.9%
├── /home/user/Documents            5.5G   2390   2808  36.5  15.0%  32.8%
├── /home/user/Pictures             3.8G   1329   1329  25.2  10.3%  22.7%
├── /home/user/Downloads            1.7G   1086   1098  11.2   4.7%  10.2%
├── /home/user/Music                 997M    610    625   6.6   2.8%   5.9%
├── /home/user/Videos                682M    259    259   4.5   1

Conclusion

In conclusion, Agedu is an excellent tool for tracking down wasted disk space on Linux systems. It is a simple yet powerful utility that can help you identify which files and directories are consuming the most disk space on your system. By using Agedu, you can quickly and easily locate old or unused files and take necessary actions to delete or move them, thereby freeing up valuable disk space. With its straightforward installation process and user-friendly interface, Agedu is a must-have tool for system administrators and Linux users who want to manage their disk space effectively.

Updated on: 28-Jul-2023

76 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements