In other words, agedu is a tool you might use to help you free up disk space. It lets you see which directories are taking up the most space, as du does; but unlike du, it also distinguishes between large collections of data which are still in use and ones which have not been accessed in months or years – for instance, large archives downloaded, unpacked, used once, and never cleaned up. Where du helps you find what's using your disk space, agedu helps you find what's wasting your disk space.
agedu has several operating modes. In one mode, it scans your disk and builds an index file containing a data structure which allows it to efficiently retrieve any information it might need. Typically, you would use it in this mode first, and then run it in one of a number of ‘query’ modes to display a report of the disk space usage of a particular directory and its subdirectories. Those reports can be produced as plain text (much like du) or as HTML. agedu can even run as a miniature web server, presenting each directory's HTML report with hyperlinks to let you navigate around the file system to similar reports for other directories.
Install agedu in ubuntu
sudo apt-get install agedu
So you would typically start using agedu by telling it to do a scan of a directory tree and build an index. This is done with a command such as
$ agedu -s /home/test
which will build a large data file called agedu.dat in your current directory. (If that current directory is inside /home/test
Having built the index, you would now query it for reports of disk space usage. If you have a graphical web browser, the simplest and nicest way to query the index is by running agedu in web server mode:
$ agedu -w
which will print (among other messages) a URL on its standard output along the lines of
That URL will always begin with ‘127.’, meaning that it's in the localhost address space. So only processes running on the same computer can even try to connect to that web server, and also there is access control to prevent other users from seeing it.
Now paste that URL into your web browser, and you will be shown a graphical representation of the disk usage in /home/test and its immediate subdirectories, with varying colours used to show the difference between disused and recently-accessed data. Click on any subdirectory to descend into it and see a report for its subdirectories in turn; click on parts of the pathname at the top of any page to return to higher-level directories. When you've finished browsing, you can just press Ctrl-D to send an end-of-file indication to agedu, and it will shut down.
After that, you probably want to delete the data file agedu.dat, since it's pretty large. In fact, the command agedu -R will do this for you; and you can chain agedu commands on the same command line, so that instead of the above you could have done
$ agedu -s /home/test -w -R
for a single self-contained run of agedu which builds its index, serves web pages from it, and cleans it up when finished.
If you don't have a graphical web browser, you can do text-based queries as well. Having scanned /home/test as above, you might run
$ agedu -t /home/test
which again gives a summary of the disk usage in /home/test and its immediate subdirectories; but this time agedu will print it on standard output, in much the same format as du. If you then want to find out how much old data is there, you can add the -a option to show only files last accessed a certain length of time ago. For example, to show only files which haven't been looked at in six months or more:
$ agedu -t /home/test -a 6m
That's the essence of what agedu does. It has other modes of operation for more complex situations, and the usual array of configurable options. The following sections contain a complete reference for all its functionality.