16.25 Listing Files by Age and SizeIf you find a large directory, and most of the files are new, that directory may not be suitable for removal, as it is still being used. Here is a script that lists a summary of file sizes, broken down into the time of last modification. You may remember that ls -l will list the month, day, hour, and minute if the file is less than six months old, and show the month, day, and year if the file is more than six months old. Using this, the script creates a summary for each of the last six months, and each year for files older than that:
The program might generate results like this: 5715 1991 3434 1992 2929 1989 1738 Dec 1495 1990 1227 Jan 1119 Nov 953 Oct 61 Aug 40 Sep - |
|