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
renamecommand that you can't do with the
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?
UPDATE: It appears that with the
rename command you can do regexes like so:
rename 's/(.*)(.*)/new$1$2/' *
mv, this doesn't appear to be possible.