bradjensen
asked on
Rename a long list of files
I need to rename a long list of files (approximately 2500 files). These files are in a directory with thousands of other important files. The filenames are formatted in this manner:
ABCD.EFGHIJ.YYYYMMDD.HHMMS S.checked
Where 'ABCD.EFGHIJ' are varialble alpha characters. YYYYMMDD.HHMMSS is the time/date stamp. The time/date stamp represents when the file was created. I need all files which were created on April 1, 2004 between the hours of 1300 and 1800 (not beyond 1800). Also, I need to remove the .checked extension from each file.
ABCD.EFGHIJ.YYYYMMDD.HHMMS
Where 'ABCD.EFGHIJ' are varialble alpha characters. YYYYMMDD.HHMMSS is the time/date stamp. The time/date stamp represents when the file was created. I need all files which were created on April 1, 2004 between the hours of 1300 and 1800 (not beyond 1800). Also, I need to remove the .checked extension from each file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect. That works well. Thanks bira!
do
x=`echo $i|cut -c1-27`
mv $i $x
done
Note that 'ABCD.' must be a stardard.
I would advice you to test it by replacing the 'mv $i $x' for
'ls $x'.
Once you find out the files are those you really want, then
run with 'mv $i $x'.