Shell command to rename multiple archives
Hello all,
I'm a Debian user. I do have 1148 txt archives with different names, and I want to change their names. More specificaly, I just want to delete 1 letter from the archives. The names are: WFI_FM1_DB_OD_B13_G100_I25_20120227_R_M_1_002.txt WFI_FM1_DB_OE_B14_G100_I75_20120227_R_M_1_002.txt WFI_FM1_DB_OD_B15_G159_I50_20120227_R_R_5_006.txt WFI_FM1_DB_OD_B15_G159_I50_20120227_R_R_4_005.txt WFI_FM1_DB_OD_B13_G100_I25_20120227_R_M_2_003.txt WFI_FM1_DB_OE_B14_G100_I75_20120227_R_M_2_003.txt etc...and I want to delete that R. Does anyone know how to do it in shell with one command?? Thanks! |
Should be fairly easy. The "rename" command may or may not do what you want it to do - I've found it to vary wildly between different distros. See what "man rename" says. However, otherwise you should be able to run this:
Code:
for i in WFI_FM1*.txt; do
If these two are true, then the code should do what you want it to do. Hope this helps, |
It works great!! Thank you!
Cheers. Quote:
|
All times are GMT -5. The time now is 09:20 PM. |