Skip to content

Instantly share code, notes, and snippets.

@mustafaturan
Created July 8, 2017 14:18
Show Gist options
  • Save mustafaturan/32df16bb4c49fbd837f777000f4b9aa2 to your computer and use it in GitHub Desktop.
Save mustafaturan/32df16bb4c49fbd837f777000f4b9aa2 to your computer and use it in GitHub Desktop.
Rename all js files into jsx
for x in *.js; do mv "$x" "${x%.js}.jsx"; done
@jonmadison-amzn
Copy link

jonmadison-amzn commented Jul 30, 2021

Awesome, but don't drop that in as a replacement, kids, it omits "src" :)

for x in src/**/*.js; do mv "$x" "${x%.js}.jsx"; done

@ElieMuluke
Copy link

ElieMuluke commented Jun 2, 2023

On Windows, this PowerShell command can be used and saved in a .ps1 file

Get-ChildItem -Path "src" -Filter *.js -Recurse | Rename-Item -NewName {$_.Name -replace '.js$','.jsx' }

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