Quote:
Originally Posted by Johng
Thank you, that's the answer
|
Are you saying your thread is SOLVED now?
Doesn't look like it to me.
Quote:
Originally Posted by Johng
change the image name from STA_1234.JPG to 1234-STA.jpg.
|
You have to find what is consistent in the filename.
Assuming the underscore _ is consistent, I'd write myself a quick oneliner:
Code:
for img in *JPG; do ext=${img##*.}; base=${img%.*}; echo mv "$img" "${base##*_}-${base%_*}.${ext,,}"; done
ext = extension (i.e. "jpg")
(not tested)
If you like what you see, remove the "echo".
You might need to adjust whether you want to delete the shortest or longest match.
See here.