-1

I have a bunch of mp3 files that iTunes copied over adding a numeric extension, that I want to remove. Is there a Mac bash command that will allow me to do that? Here is what the directory looks like. The files in question have 2 digits, and a space.

enter image description here

  • What is your research effort? What have you tried? Where are you stuck? "Gimme code" does not constitute a good question. My hint: vidir. You may get answers tailored to your specific request but in general I find the tool quite useful for renaming. – Kamil Maciorowski Dec 30 '19 at 18:44

2 Answers2

1

Looks like a duplicate of:

remove numbers from filenames in Mac OS X

Modify the answer from there:

for name in *; do mv -v "$name" "${name#[0-9]* }"; done

I would first move 1 or 2 files into their own directory and try running that. If you get the desired results, then go into your main music directory and run it again.

kamil234
  • 176
0

There is rename command in linux which you can use.

rename 's/^[0-9][0-9] //' *.mp3

The above command matched all the .mp3 files starting with two numbers followed by space. Check this link or man page for more details. I'm not sure if this command is available for mac.

Nitish
  • 103