Friday, April 7, 2017

command line - Mass file renaming in Bash but keeping a section of the file name

I have a large number of .jpg file that have extraneous data ahead of a file id that i need to have removed to better set up my file structure for a later project. How can I do a batch rename in either command line or Bash (bash is preferable)




Example:
A_file_name_f3xe3_1_60113520.jpg - (60113520 being the ID)
To Become:
60113520.jpg



All files have underscores before the ID, but there are randomly placed extra underscores elsewhere in the name.

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...