Skip to content

Instantly share code, notes, and snippets.

@ehbc221
Created May 23, 2024 11:54
Show Gist options
  • Save ehbc221/262881dc3261b97ee51fa4d3e3e83955 to your computer and use it in GitHub Desktop.
Save ehbc221/262881dc3261b97ee51fa4d3e3e83955 to your computer and use it in GitHub Desktop.
bash rename files in folder
# Example: rename all your next js files from js to ts
# Rename js files
find app/* -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
# Rename jsx files
find app/* -name "*.jsx" -exec sh -c 'mv "$0" "${0%.jsx}.tsx"' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment