One thing I do fairly often is export songs from iTunes on to USB Flash Disk; mainly because my car has an internal hard drive and I want to update my song list. Unfortunately, when you drag songs out of iTunes into a Finder folder, each filename has the track number appended to it at the beginning. Example, all files are named like below (please don’t judge the song selection!):
You can edit these manually, but here’s a quick trick using Terminal.
- Open Terminal
- Change your directory to the folder containing music, i.e.
cd Desktop/Music/Roy - Check if you’re in the right folder using the ls command.
- In my case, I want to trim the first 3 characters, so I use the following command:
for f in *;do mv “$f” “${f:3}”;done - Check the files again using ls command
And voila, you’re done! In case you want to cut out more characters, change the number “3”, to the value of your choice.