title: Linux/Unix Replacing a pattern in a string and saving to a new file with sed
body: <p>I have a task, to replace specific pattern in a string.
  So far I tried commands like  <code>sed -e 's/text_to_find/text_to_replace/g' file</code> 
  but I don't why it changed all string, not just a part which I wanted to change.</p>
  
  <p>what I want to do is in every string that contains word <code>china</code> to add this <code>Tomas_proxy.lt</code></p>
  
  <p>To make it very clear, what I am looking for, there is file I am using:</p>
  
  <pre><code>987173,businesswirechina.com
  988254,chinacfa.com
  988808,1012china.com
  989146,chinawise.ru
  989561,chinaretailnews.com
  989817,mobileinchina.cn
  990894,cmt-china.com.cn
  990965,chinajoy.net
  992753,octaviachina.com
  993238,chinadftzalex.com
  993447,china-kena.com
  </code></pre>
  
  <p>And this is I would like to see in a new file</p>
  
  <pre><code>987173,Tomas_proxy.lt/businesswirechina.com
  988254,Tomas_proxy.lt/chinacfa.com
  988808,Tomas_proxy.lt/1012china.com
  989146,Tomas_proxy.lt/chinawise.ru
  989561,Tomas_proxy.lt/chinaretailnews.com
  989817,Tomas_proxy.lt/mobileinchina.cn
  990894,Tomas_proxy.lt/cmt-china.com.cn
  990965,Tomas_proxy.lt/chinajoy.net
  992753,Tomas_proxy.lt/octaviachina.com
  993238,Tomas_proxy.lt/chinadftzalex.com
  993447,Tomas_proxy.lt/china-kena.com
  </code></pre>
  
  <p>P.s. This is just example file, In real file I am using, not every line has word <code>china</code> ,there is 100000 strings and lets say about 500 has <code>china</code></p>