Skip to content

Instantly share code, notes, and snippets.

@mfd
Created October 3, 2017 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfd/4d854ca7b81aac5b987efaf08860378b to your computer and use it in GitHub Desktop.
Save mfd/4d854ca7b81aac5b987efaf08860378b to your computer and use it in GitHub Desktop.
Bulk Rename in osx terminal
# General format:
brew install rename
# General format:
rename -v s/OLD/NEW/ FILENAMES
# Where:
# - OLD is a regular expression
# - NEW is the replacement pattern
# - FILENAMES is a list of files to search/replace
# For example, to change all .JPG file extensions to .jpg.
rename -v s/\.JPG$/.jpg/ *
# To test it without actually renaming any files, use the -n flag:
rename -n s/\.JPG$/.jpg/ *
rename -nvs searchword replaceword *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment