Batch Renaming: Change files' extensions in many sub-directories
Hi all -
I'm trying to rename a large number of files all at once and need some help figuring out the command line syntax to do it. I've already done quite a bit of research with the rename and mv commands, but so far haven't found a solution that seems to work for me. So:
The files exist here:
/public_html/files
However, there are many subdirectories within /public_html/files, and the files within those subdirectories must also be renamed with the same operation. (I'm hoping to be able to rename the files in those subdirectories at the same time, since going through every single one of the sub-dirs -- there are 1000s -- would be very time consuming.)
The files that need renaming are, shall we say, .zzz files. All of them end in .zzz, but the beginnings of their file names are, of course, different.
NOTE: There are OTHER files in these directors that are NOT .zzz files (let's say .jpg files), and those files CANNOT be affected by this rename command.
Let's say I would like to rename all .zzz files within all subdirectories to .zzz_disabled (basically, to disable these files from being accessed), but keep the first part of their file names in tact.
So:
dog_ran_up_the_hill.zzz
BECOMES
dog_ran_up_the_hill.zzz_disabled
And that's pretty much it!
I think I've included all necessary info here.
Can anyone help me come up with the proper command line syntax to batch rename all the files in all the directories?
Thanks so much!
|