Skip to content

Instantly share code, notes, and snippets.

@mLuby
Created September 2, 2016 21:05
Show Gist options
  • Save mLuby/e1157dfe8434450da9f8016fd519e728 to your computer and use it in GitHub Desktop.
Save mLuby/e1157dfe8434450da9f8016fd519e728 to your computer and use it in GitHub Desktop.
rename files en-masse
IFS=$'\n'; # change delimiter so it works on all but newline filenames
for file in $(find ./ -name '*.js');
do mv "${file}" "${file}x" # file%jsx removes jsx from end of file
done
for file in $(find ./ -name '*spec.jsx');
do mv "${file}" "${file/unit.spec.jsx/spec.js}" # file%jsx removes jsx from end of file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment