zsh renaming sets of files

I want to rename a couple of dozen files in a folder that contains over 100 files. The files to be renamed all have existing names that contain a single pattern. For example,


abcSOURCEFILE1

xyzSOURCEFILE2

jklSOURCEFILE3


etc. should be renamed to


SOURCEFILE1

SOURCEFILE2

SOURCEFILE3


etc.


Is there a single command that can do this? Something like "mv *SOURCEFILE? SOURCEFILE? Is the actual "rename" command useful? Or do I need a script?


TIA,


Mark


P.S. Is there a tutorial somewhere that shows how to do this? When I searched the Internet, I found either examples that were too simple, or descriptions that were too complex (because they were trying to cover the full power of globbing, or they distributed the infomation needed to construct a solution over several documents - the "man" pages have this problem, or both).

iMac 27″, macOS 10.15

Posted on Dec 29, 2020 6:16 PM

Reply

Similar questions

1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

zsh renaming sets of files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.