Find file older than given number in bash (every file contains 6 digit number in the file name)
Posted on 2009-07-06
I have lot of files which contains a 6 digit number in file name.. for example:
and so on....
Basically the number is generated using the "date +%y%m%d" and added to the file name via a shell script. Since this script runs daily, every day a new file is generated.
Now i want a shell script to find files older than the 6 digit number provide by me to the script and delete them. For example if i give 081201 as a input to script then the script should look into all filenames in that directory, find files which has older 6 digit number than 081201 in filename and then delete those files...
OS :- Solaris 9 Sparc Version
Shell :- bash 2.05