Command
grep -rl matchstring somedir/ | xargs sed -i 's/string1/string2/g'
Note: The forward slash '/' delimiter in the sed argument could also be a different delimiter (such as the pipe '|' character). The pipe delimiter might be useful when searching through a lot of html files if you didn't want to escape the forward slash, for instance.
matchstring is the string you want to match, e.g., "football" string1 would ideally be the same string as matchstring, as the matchstring in the grep command will pipe only files with matchstring in them to sed. string2 is the string that replace string1.
Example
grep -rl '5.00.00.40' ./ | xargs sed -i 's/5.00.00.40\/vc/5.79.17.43\/BB/g'
Extracted from : http://vasir.net/blog/ubuntu/replace_string_in_multiple_files/
Following Sinhala unicode translater is a very useful tool for all the Sinhala web users who needs a quick sinhala unicode typing. The main advantage of this tool is that user can type the sinhala characters using English (commonly known as Singlish) Use the following link to access the online unicode converter. http://www.ucsc.cmb.ac.lk/ltrl/services/feconverter/t1.html
Comments
Post a Comment