SUMMARY : deletion of old files

From: Maccy <>
Date: Mon Oct 29 2001 - 12:05:42 EST
My sincere thanks go out to :-

Neill, Mark (MBS)
Mike Salehi
Daniel Azzarri
Buddy Lumpkin
Paul LaMadeleine
Frans Tigelaar
Dylan Northrup
dave floyd
Chris Hoogendyk
David Evans
Edward Scown
Andy Bach

Most suggestions centred around the following (apart from read the man
page for 'find') :-

find /single-directory -ctime 60 -exec rm -f {} \;

This will delete all the files in "single-directory" that are older than
60x24 hours. If in doubt then use "ls -l" intead of the "rm -f" exec.

Oops. forgot. You can use 'mtime' twice in a find command.
find $DIR -mtime -10 -mtime +5 -exec rm {} \;
will find all files between 5 and 10 days old, and delete them.

My preferred solution was this script from Edward Scown :-

for file in `ls -al | awk '/Aug/ {print $9}'`
rm -f $file
echo "Removed $file"

Many thanks to all who responded, or may yet respond :-)

Best regards,
Mark Mahabir

sunmanagers mailing list
Received on Mon Oct 29 09:10:27 2001

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:26 EST