Skip to content

Instantly share code, notes, and snippets.

@afternoon
Created February 15, 2014 18:04
Show Gist options
  • Save afternoon/9022899 to your computer and use it in GitHub Desktop.
Save afternoon/9022899 to your computer and use it in GitHub Desktop.
Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
@blukanov-newsuk
Copy link

find . -path ./node_modules -prune -o -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;

if your sources are in ./ and you must skip node_modules

@Wiz-Amit
Copy link

Wiz-Amit commented Oct 1, 2022

I had to do

find app/src -name "*.js" -exec sh -c 'mv "${0}" "${0/js/ts}"' {} \;

@rafalkrol-xyz
Copy link

Thank you very much indeed!

@kishanthachat
Copy link

+1, Thanks mate!

@ther0y
Copy link

ther0y commented Jan 30, 2023

+1, Thanks

@mkajs
Copy link

mkajs commented Jun 30, 2023

nice

@AlonBruQuali
Copy link

Worked a charm, thanks

@iverenshaguy
Copy link

Thanks!

@giacomorebonato
Copy link

Thank you!

@Igor-Golub
Copy link

Thanks!

@Thomas0642
Copy link

thanks my man

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