Batch rename recursively
I would like to replace multiple underscores with hyphens but I have 26,000 files to rename. They are all in one file structure and multiple sub-directories.
It would be much simpler if I had a script to do it. Here are some samples of the file names:
Example 1
books/horrors/small/books_horrors_small_0000000386.jpg
Rename to
books/horrors/small/books-horrors-small-0000000386.jpg
Example 2
books/comedy/small/books_comedy_small_0000001687.jpg
Rename to
books/comedy/small/books-comedy-small-0000001687.jpg
There are 26,000 files that look similer to that and are all in different directories.
The only thing I need to do is replace all the underscores _ with hyphens -
|