unix ksh file rename

June 23, 2011 at 10:43:17
Specs: Windows XP
Help please, I have multiple files in a folder that end with .999.dat, I need to rename the files to "filename.dat" (need to get rid of the .999) ie file name payroll123a.999.dat need to rename to payroll123a.dat. thanks

See More: unix ksh file rename

Report •

June 23, 2011 at 12:08:35

cd <to_your_directory>

for i in *\.999.dat
   mv $i `echo "$i"|sed 's/\.999//g'`

Report •

June 24, 2011 at 03:32:57

We see your name a lot on this fine site helping other people, we would like to thank you for all your help and support. Thank you

Report •

June 24, 2011 at 10:10:45

You're welcome. And thank you for the kind words. I appreciate it.



Report •
Related Solutions

Ask Question