The Computer Oracle

Mass Remove File Prefix on a Mac?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Puzzle4

--

Chapters
00:00 Mass Remove File Prefix On A Mac?
00:22 Accepted Answer Score 32
00:56 Answer 2 Score 11
01:43 Answer 3 Score 8
02:21 Answer 4 Score 2
02:45 Thank you

--

Full question
https://superuser.com/questions/398709/m...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#macos #mac #rename #batchrename

#avk47



ACCEPTED ANSWER

Score 32


The easiest solution might be to use the commercial A Better Finder Rename to achieve this.

For a free alternative, you can install the command-line rename utility:

  • install Xcode
  • install Homebrew
  • open Terminal.app and do brew install rename

You can now use, in the Terminal, either of:

rename -d img_ *
rename "s/^img_//" *

to strip away the prefix.




ANSWER 2

Score 11


You can use Automator's Rename Finder Items action:

  1. Start Automator, select Workflow, and add Get Specified Finder Items and Rename Finder Items from the library on the left to the workflow area on the right by double-clicking.

  2. Drag and drop the files you want to rename to the list in Get Specified Finder Items.

  3. Change Rename Finder Items to Replace Text as desired, and click the Run button.

Automator screenshot

Result after execution: Result

You can easily change this workflow to make it repeatable, e.g. with selected Finder items instead, and save it as Application or Service.




ANSWER 3

Score 8


A quick visit from the year 2019 to give an update.

osX has something like this built into finder now.

  • Open finder

  • Select all the files you want renamed

  • From the right-click menu (or File menu) choose the Rename # items option

  • You'll be presented with a dialog window with options, one of which is Replace Text

  • Enter your prefix - "img_" in the Find box and leave the Replace box empty

  • Click Rename




ANSWER 4

Score 2


If you want an elegant, easy, and feature-rich solution, I personally like Name Mangler.

Used to be called File List and was free, now it costs $10. May be a little steep for some people, but it's well-written and extremely functional if you don't want to get into the command-line methods of doing this.