Skip to content

Instantly share code, notes, and snippets.

@jcastellanos926
Last active September 24, 2020 11:02
Show Gist options
  • Save jcastellanos926/eaf9f0c5962d4c1af9e427555bfca660 to your computer and use it in GitHub Desktop.
Save jcastellanos926/eaf9f0c5962d4c1af9e427555bfca660 to your computer and use it in GitHub Desktop.
Replace a string in multiple files

Replace a string in multiple files

Case sensitive:

find ./ -type f -exec sed -i 's/string1/string2/g' {} \;

Case insensitive:

find ./ -type f -exec sed -i 's/string1/string2/gI' {} \;

Occurrences of "foo" will be replaced with "bar".

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