How to Find Wasted Disk usage With Agedu on Linux
agedu is a Linux tool used to track down the wasted disk usage. This tool will help you to find out the right stuff to delete and free up your disk space.
It scans a directory tree and produces reports about how much disk space is used in each directory and sub directory, and also how that usage of disk space corresponds to files with last-access times a long time ago.
sk@sk:~$ sudo apt-get install agedu
Agedu package will not be found in official repositories. So first, add EPEL repository with the following command:
[root@server ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Now install Agedu with following command:
[root@server ~]# yum install agedu -y
agedu [ options ] action [action...]
If you want to scan your home directory for disk usage, the command should be:
sk@sk:~$ agedu -s /home/sk/
The above command will scan all directories, sub directories for disk usage and build a large data file called agedu.dat in your current directory. If that current directory is inside /home/sk, it is smart enough to discount its own index file.
The sample output will be as shown below:
Built pathname index, 28928 entries, 2505705 bytes of index Faking directory atimes Building index Final index file size = 9538096 bytes
Now run the following command to see the reports:
sk@sk:~$ agedu -w
You will see an output like shown below:
Using Linux /proc/net magic authentication URL: http://127.0.0.1:46389/
Open up your browser and enter the URL http://127.0.0.1:46389/ shown in the above output.
The above graphical output shows the disk usage of the /home/sk directory in various colors. You can figure out which files/directories should be removed to free up the disk usage from the above output. Click on any directory to view the disk usage of its sub directories. To exit from the command, just press CTRL+D.
Assign custom port for Agedu
Use the following command to assign the custom port for Agedu:
sk@sk:~$ agedu -w --address 127.0.0.1:9000
sk@sk:~$ agedu -w --address 192.168.1.100:9000
Here 192.168.1.100 is my local IP address. You may see the following output after entering the above command:
Using Linux /proc/net magic authentication URL: http://127.0.0.1:9000/
Now you will able to access the Agedu web interface with URL http://127.0.0.1:9000 from your browser. To exit from Agedu command press CTRL+D.
Enable password protection for Agedu
You can secure Agedu web interface with a password. Use the following command to generate a password:
sk@sk:~$ agedu -w --address 127.0.0.1:9000 --auth basic
You may have the following output. Note down the username and password:
Username: agedu Password: gehs92b5rf2y83mc URL: http://127.0.0.1:9000/
It will create a username and password automatically for you. Open up the browser and navigate to http://127.0.0.1:9000. It will ask the username and password as shown below. Enter the username and password.
You can set a custom username and password if you like. To do so, enter the following command:
sk@sk:~$ agedu -w --address 127.0.0.1:9000 --auth basic --auth-fd 0
Now enter your username and password in the following format:
You should enter the username (eg. sk) and put a colon (:) and password (eg. password). Afterwards, press CTRL+D to exit. Now you will be able to access Agedu web interface with new username and password.
View Agedu reports from terminal
To view the reports from the terminal, use the following command:
sk@sk:~$ agedu -t /home/sk/
You may see the following like output:
25606780 /home/sk/Personal 384 /home/sk/Pictures
To access files which are not looked(accessed) for six months or more, use the following command:
sk@sk:~$ agedu -t /home/sk/ -a 6m
You can use the switches d for days, w for weeks, m for months and y for years. For example, if you want to see the files which are not accessed 7 days or more, enter the following command:
sk@sk:~$ agedu -t /home/sk/ -a 7d
View reports of a particular types of files
For example, if you want to see the disk usage taken by PDF files and want to omit all other files, just enter the following command:
sk@sk:~$ agedu -s . --exclude '*' --include '*.pdf'
The above command will scan only for disk usage taken by PDF files in the current directory and it omit all other types of files from scanning.
To view the report, enter the following command:
sk@sk:~$ agedu -w Using Linux /proc/net magic authentication URL: http://127.0.0.1:52272/
Open up browser and navigate to URL http://127.0.0.1:52272/. Now you will see the output only for disk usage taken by PDF files.
sk@sk:~$ agedu -s /home/sk/Downloads --exclude '*' --include '*.pdf'
The above command scans PDF files in the /home/sk/Downloads and omits all other directories and file types.
Deleting unused files
You have found out which directory is not using for long time, you can simply delete the directory or multiple directories with following command to free up the disk space:
sk@sk:~$ rm -fr directoryname
To delete the index file, enter the following command:
sk@sk:~$ agedu -R
rm -fr agedu.dat
To know more Agedu commands, refer the man pages.
sk@sk:~$ man agedu
Like us on Facebook
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- Manage Databases And Hosted Servers Remotely With DbNinja : Database administration via command line is bit difficult for newbie system and database administrat...0 comments |
- Setup IT And Asset Management System With GLPI On Debian/Ubuntu : GLPI is the Information Resource-Manager with an additional Administration Interface. You can use it...0 comments |
- How To Configure Linux Clients To Authenticate Using OpenLDAP : This is the continuation of our previous tutorial. In our previous tutorial we learned how to instal...0 comments |
- Install FrostWire 5.6.9 In Elementary OS 'Luna'/ Ubuntu / Linux Mint : FrostWire is a peer-to-peer file sharing program for the gnutella and BitTorrent protocols. FrostWir...0 comments |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- How To Install Linux Kernel 3.12.4 In Ubuntu
- Firefox 26 Has Been Released, How To Install It In Ubuntu And Its Derivates
- How To Install Brasero In Elementary OS ‘Luna’
- Install Sayonara Player In Elementary OS / Ubuntu / Linux Mint
- Manage Databases And Hosted Servers Remotely With DbNinja
- Install FrostWire 5.6.9 In Elementary OS ‘Luna’/ Ubuntu / Linux Mint
- Setup IT And Asset Management System With GLPI On Debian/Ubuntu
- How To Configure Linux Clients To Authenticate Using OpenLDAP
- How To Install Netflix In Ubuntu
- cowsay And fortune Combined Together
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .