Replace ":" from multiple files names (even recursively in directories)
Hi
I need to replace ":" from multiple files names, since I am going to copy those files from a linux partition, which admit the ":" to a FAT32 partition, which does not. Example: original name: eg06_ana_21-05-06_09:21:03.JPG wished name: eg06_ana_21-05-06_09-21-03.JPG I have googled a lot but I have not been able to adapt the examples given by people to my aim. It seems that rename command is what I should use, but I have no idea to build the correct pearl expression. Thanks a lot. |
Code:
$ ls [edit] But while you're at it, why not convert the date to an iso date so your files sort chronologically? =} Code:
for i in $( find -name \*JPG ); do echo mv $i $(echo $i|sed -r -e 's/([0-9]{2})-([0-9]{2})-([0-9]{2})/\3\2\1/' -e 's/://g'); done Cheers, Tink |
I ask for help only after having actually tried every single way I know to be able to do something myself.
Thanks a lot for your useful help. It has been accurate and quick! Quote:
|
Quote:
Cheers, Tink P.S.: Please don't top-post with quotes. |
All times are GMT -5. The time now is 12:09 AM. |