Why is rename command missing from macOS?
In the default install of macOS, rename man page is available in the section 2. As you can notice from the man page, rename is not a command but a BSD system call.
The Homebrew formula named rename is a Perl script. You should be fine with installing it. In-fact it can give you much more flexibility than plain mv command.
After you have installed rename utility via Homebrew, running man rename
will show the man page for the installed utility and not the BSD system call.
I'm also curious to know if there is a known explanation for why the command does not exist in the first place.
rename is not a standard Unix command.
And why is there a man page for a command that does not exist?
As mentioned above, the man page present refers to the system call by the same name.
With rename
command you can search and replace string in multiple files in simply way:
rename 's/oldstring/newtext/' file00*
It's really useful. With mv
you cannot do the same. Unless you get loop to work:
for file in file00*; do new=${file/oldstring/newtext}; mv —- "$file" "$new"; done