Skip to content

Instantly share code, notes, and snippets.

@serafdev
Created November 20, 2020 19:19
Show Gist options
  • Save serafdev/e867b387a195e20265b23848f2f7a2c3 to your computer and use it in GitHub Desktop.
Save serafdev/e867b387a195e20265b23848f2f7a2c3 to your computer and use it in GitHub Desktop.
Replace oldString with newString in all files in folder and nested folders
#!/bin/sh
# Replace oldString with newString in all files in folder and nested folders
grep -rl "oldString" /your/path | xargs sed -i '' -e "s/oldString/newString/g"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment