Skip to content

Instantly share code, notes, and snippets.

@mauricios
Last active April 23, 2022 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauricios/2a502d632584739b73fcf9a856162b9d to your computer and use it in GitHub Desktop.
Save mauricios/2a502d632584739b73fcf9a856162b9d to your computer and use it in GitHub Desktop.
Text manipulation commands
!# /bin/bash
# Replace string in all files in a directory (macOS)
grep -Rnl "old_string" **/*.txt | xargs sed -i "" 's/old_string/new_string/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment