Skip to content

Instantly share code, notes, and snippets.

@unicornist
Last active September 4, 2018 16:34
Show Gist options
  • Save unicornist/ced40ba814536b5b851ef5c36f4f0977 to your computer and use it in GitHub Desktop.
Save unicornist/ced40ba814536b5b851ef5c36f4f0977 to your computer and use it in GitHub Desktop.

Windows

  • Rename All (e.g. *.jpg_*.jpg)
    for /f "delims=" %i in ('dir /b /a-d *.jpg') do ren "%~i" "_%~ni%~xi"
    • %~ni is for the name part (*)
    • ~xi is for the extension part (.jpg)

  • Replace All

TODO


Unix

  • Replace All (e.g. foobar in a git repo)
git grep -lz 'foo' | xargs -0 perl -i'' -pE "s/foo/bar/g"

  • Rename All

TODO

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