0

I am using this command to replace a word with another in many filenames (batch):

rename 's/oldname/newname/g' **

But it works for the current open folder only. I am not sure how to make it work for that directory and all the sub-directories.

Thanks.

Mike
  • 2,051
  • 4
  • 28
  • 46

1 Answers1

0

Mike, Try this: Create new folders, move files, delete old folder. Then, move over directories. Regards

  • Can you provide the command needed to accomplish this in a batch – TMin Oct 25 '17 at 20:47
  • 1
    See this article: https://stackoverflow.com/questions/15012631/rename-files-and-directories-recursively-under-ubuntu-bash – Martin Barber Oct 25 '17 at 21:07
  • Try doing this (require bash --version >= 4): shopt -s globstar rename -n 's/special/regular/' ** Remove the -n switch when your tests are OK – Martin Barber Oct 25 '17 at 21:07