Created
January 15, 2023 13:53
-
-
Save wipermail/3068121b4cfe58ba52b9768b40f23012 to your computer and use it in GitHub Desktop.
How to replace a string in multiple files in linux command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Similar to Kaspar's answer but with the g flag to replace all the occurrences on a line. | |
find ./ -type f -exec sed -i 's/old_string/new_string/g' {} \; | |
For global case insensitive: | |
find ./ -type f -exec sed -i 's/old_string/new_string/gI' {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment