to rename batch files with bash script in mac terminal, type this command:
for f in *.jpg
do
mv "$f" "${f/*. /}"
done
in a bash file named rename-files.sh
put the file in a folder where the files are going to be rename.
run the bash file by : sh rename-files.sh
code description:
mv command means move, mv "old_name" "new_name"
it actually move a file with an "old-name" to a new file named "new_name".
$f matches to *.jpg
to move the renamed files to a folder, these steps must be followed: create the destination folder, then add the destination name following the "new_name".