title: sed add lines before end of file
body: <p>I am trying to add 2 lines before the end of <code>limits.conf</code> file via shell.</p>
  
  <p>I wrote:</p>
  
  <pre><code> sudo sed '$ \\*                hard    nofile          128000\n \\*                soft    nofile          128000 ' /etc/security/limits.conf 
  </code></pre>
  
  <p>However I get:</p>
  
  <blockquote>
    <p>sed: -e expression #1, char 3: unknown command: `\'</p>
  </blockquote>
  
  <p>I tried also:</p>
  
  <pre><code>sudo sed '$ \*                hard    nofile          128000\n \*                soft    nofile          128000 ' /etc/security/limits.conf`
  </code></pre>
  
  <p>and I get the same error</p>
  
  <p>How can I simply add:</p>
  
  <pre><code>*                hard    nofile          128000
  *                soft    nofile          128000
  </code></pre>
  
  <p>to one line before the end? (as the end of the file is <code>#END FILE</code>)</p>