Skip to content

Instantly share code, notes, and snippets.

@dylan-chong
Created November 3, 2017 23:36
Show Gist options
  • Save dylan-chong/e7b16a982e604ba62fc52e3ab0f98196 to your computer and use it in GitHub Desktop.
Save dylan-chong/e7b16a982e604ba62fc52e3ab0f98196 to your computer and use it in GitHub Desktop.
Batch rename files
find * | xargs rename -n 's/part-of-filename-to-replace/replacement/' # -n for dry run
@dylan-chong
Copy link
Author

dylan-chong commented Aug 14, 2019

I have found a better way:

Using Vim, look at the instructions for :h rename-files

This is much better because you can confirm the results of the rename manually, and even remove/add files from the list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment