1

So I have a bunch of files created with the name *FINAL.mkv and I have a (1st) script to remove all the files except files with FINAL.mkv

I need help renaming the new files back to the original *.mkv, any help appreciated!

Example file tree:

Stargate.mkv

StargateFINAL.mkv

Now after 1st script

StargateFINAL.mkv

What I want to end up with (this is in regard to recursive converting of videos)

Stargate.mkv
FreeSoftwareServers
  • 1,109
  • 1
  • 13
  • 31

1 Answers1

2

Assuming the word FINAL comes only once in the filenames, you can do:

rename -n 's/FINAL//' *.mkv

This will do the dry run. After being sure you can carry out the operation :

rename 's/FINAL//' *.mkv
heemayl
  • 90,425
  • 20
  • 200
  • 267
  • That was fun, script is perfected, thanks! [Original Script heemayl helped with](http://askubuntu.com/questions/660827/remove-audio-streams-of-videos-recursively-without-converting-audio-or-video-w/660828#660828) – FreeSoftwareServers Aug 13 '15 at 07:15