Skip to content

Instantly share code, notes, and snippets.

@tgmarinho
Created October 30, 2020 21:55
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 tgmarinho/0b9dec1109d747694e9221ede436b4ec to your computer and use it in GitHub Desktop.
Save tgmarinho/0b9dec1109d747694e9221ede436b4ec to your computer and use it in GitHub Desktop.
renaming multiples files in subdirectory using rename and find
brew install rename
tgmarinho.com/src on  main [✘!?] took 25s
❯ find . -type f -name "*.js" -exec rename 's/\.js$/.tsx/' '{}' \;
tgmarinho.com/src on  main [✘!?] took 3s
❯ find . -type f -name "styled.tsx" -exec rename 's/\.tsx$/.ts/' '{}' \;
tgmarinho.com/src on  main [✘!?]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment