Skip to content

Instantly share code, notes, and snippets.

@hayatbiralem
Last active October 2, 2016 21:00
Show Gist options
  • Save hayatbiralem/00be5845f7d4f7485fa8c47b6e172332 to your computer and use it in GitHub Desktop.
Save hayatbiralem/00be5845f7d4f7485fa8c47b6e172332 to your computer and use it in GitHub Desktop.
Bash script for change file extensions in a directory
#!/bin/bash
# https://github.com/Microsoft/TypeScript/issues/2302#issuecomment-144959412
find . -name "*.js" -exec bash -c 'mv "$1" "$(sed "s/\.js$/.ts/" <<< "$1")"' - '{}' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment