Skip to content

Instantly share code, notes, and snippets.

@teknikqa
Last active December 6, 2016 12:41
Show Gist options
  • Save teknikqa/2c0b2aee4aa2135467c4af6fb2f30d06 to your computer and use it in GitHub Desktop.
Save teknikqa/2c0b2aee4aa2135467c4af6fb2f30d06 to your computer and use it in GitHub Desktop.
Rename files and all instances of old name within the files
brew install rename
# Rename all filenames from old_name to new_name
rename 's/old_name/new_name/g;' *
# Rename all instances of old_name with new_name inside the files in current directory
perl -pi -w -e 's/old_name/new_name/g;' *
# Just to be safe search for the old_name
ag old_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment