Why is rename command missing from macOS? I usually rename files and directories with the mv command. I'm reading a book on bash shell that mentions the rename command. When I executed man rename a man page was shown. However, when I entered rename on bash shell, it reported:

-bash: rename: command not found


I did some research and discovered that you can install the rename command with Homebrew.


Is there any good reason not to install it with Homebrew?
Is there anything you can do with the rename command that you can't do with the mv command?


I'm also curious to know if there is a known explanation for why the rename command doesn't exist in the first place. And why is there a man page for a command that does not exist?
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.