I have a folder that contains over 500+ files with a certain prefix. Those files are spread in multiple folders in one directory. My objective is to re-name that prefix in those multiple files.
Sample File Names and Paths:
- MyFiles/my-old-FileOfAlice.txt
- MyFiles/Folder 1/my-old-FileOfTom.odt
- MyFiles/Folder 2/my-old-FileOfJane.doc
The Objective Is To Rename Them To:
- MyFiles/my-new-FileOfAlice.txt
- MyFiles/Folder 1/my-new-FileOfTom.odt
- MyFiles/Folder 2/my-new-FileOfJane.doc
Notes:
- The files do not have the same extension.
- The files are spread in multiple folders under the same directory. I am using Kubuntu 16.10. Any Ubuntu oriented answer will be accepted and appreciated.
Any command line, program, guide, tutorial, or link would be greatly appreciated. Thanks in advance!
You can use the following command:
This searches for files containing
-old-
recursively beginning in your current directory and renames them by replacing the-old-
with-new-
.Note: replacing
old
may be enough, but I included the-
in case, there is a secondold
in the name (like my-old-Folders.doc).