I have a list of files that are named
I need a command that deletes all files with the file name less than or equal to 200909. So basically if the file name is Comparison_200910.xls it won't be deleted but if it were Comparison_200908.xls then it is going to be deleted. The directory has thousands of files dating back to 2006.
Prehaps something like:
% rm Comparison_2006[0-9][0-9].xls
% rm Comparison_200[0-9][0-9].xls
Then you could do the 2009 ones manually.
Assuming the files were created on the dates
indicated by the names,
you might also be able to use the -mtime options
to find to do the job,
but I'd have to try it a few times
to determine the right way to use it.
Yet another way is to "ls *.xls >remove.sh",
and then edit the file into the appropriate
This might be tedious, depending
on your text editor.