Here's how I change all the file extensions in the current directory on DebianDebian or Ubuntu.
rename "s/oldExtension$/newExtension/" *.txt
(This is the Perl rename command, not the util-linux one. See Why is the rename utility on Debian/Ubuntu different than the one on other distributions, like CentOS?)
On MacOS, user Monkpit reports that they were able to use brew install rename to get this to work.