title: SED/tr etc.. : How to comment out a line that contains "string" in a file?
body: <p>my file contains lines such as these: </p>
  
  <pre><code>-A INPUT -m state --state NEW -m tcp -p tcp --dport 2000 -j ACCEPT
  -A INPUT -m state --state NEW -m tcp -p tcp --dport 2001 -j ACCEPT
  -A INPUT -m state --state NEW -m tcp -p tcp --dport 2002 -j ACCEPT
  </code></pre>
  
  <p>i want to comment out ( add # infront of ) the line that is</p>
  
  <pre><code>-A INPUT -m state --state NEW -m tcp -p tcp --dport 2001 -j ACCEPT
  </code></pre>
  
  <p>how can i do this via SED or some other method via command line ?</p>
  
  <p>should i seek for ..  e.g..</p>
  
  <pre><code>2001
  </code></pre>
  
  <p>and then comment out that whole line ( add # infront of )</p>
  
  <p>or should i search for the entire line and then replace it with a new one that contains # ?</p>
  
  <p>what would be the most practical method ? ( fastest )</p>