Linux: how to batch rename files, truncate characters in the middle, and end filename
I have about a thousand files that I need to rename. All filenames look like this:
XXXXppppppp-ppppp_S !! _ L001XXX_001.extension
Where X is the information I need to save and! is a sequentially increasing number (i.e. 01, 02 ... 99).
I really can't outline the rename command and how to achieve what I need to do. Basically, I want to keep the first four characters, remove the next 22, keep the next 3, and remove the ending 4. I would also like to keep the extension.
Thank!
+3
source to share