Skip to content

Instantly share code, notes, and snippets.

@joerx
Created October 3, 2019 04:58
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 joerx/50aae01515158b993239be0fc3e12c67 to your computer and use it in GitHub Desktop.
Save joerx/50aae01515158b993239be0fc3e12c67 to your computer and use it in GitHub Desktop.
Batch rename files
# for discussion and alternatives, see https://unix.stackexchange.com/questions/227662/how-to-rename-multiple-files-using-find
find . -type f -name general.tf -not -path '*/.terraform/*' -exec sh -c 'x="{}"; mv "$x" "${x/general/backend}"' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment