Bulk conditional file name change
You probably want to use regex for this. Depending on the version of your question, it's pretty straightforward. There are a number of good sites to get started on the basics. In a sense, you already have seen a little taste of it: the "*" in "*.mp3" is a regex concept (meaning 'match any symbol 0 or more times'). Try something like (https://www.debuggex.com) or (http://www.regexr.com).

The simple version of your question is actually very simple indeed, so you might get away with just this approach:

echo '01 ab cd.mp3' | sed 's/ / - /'


This sed command is basically a regex-defined find and replace. It finds ' ' and replaces it with ' - ', the first time only. (Much more on sed here: https://www.gnu.org/software/sed/manual/sed.html#The-_0022s_0022-Command)

I would also be surprised if there weren't a number of scripts and things specifically for processing mp3 filenames that will already do this for you, but there's no reason you can't do it yourself in Terminal.