Created
October 13, 2012 18:06
-
-
Save costis/3885595 to your computer and use it in GitHub Desktop.
Search and replace in files
This file contains 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
The other big option here is simply not to use vim: | |
sed -i 's/pattern/replacement/' <files> | |
or if you have some way of generating a list of files, perhaps something like this: | |
find . -name *.cpp | xargs sed -i 's/pattern/replacement/' | |
grep -rl 'pattern1' | xargs sed -i 's/pattern2/replacement/' | |
and so on! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment