title: shell: delete the last line of a huge text log file
body: <p>I asked a <a href="https://stackoverflow.com/questions/12175344/php-pop-the-last-line-of-huge-text-log-file">question</a> regarding popping the last line of a text file in PHP, and now, is it possible to re-write the logic in shell script?</p>
  
  <p>I tried this to obtain the last line:</p>
  
  <pre><code>tail -n 1 my_log_file.log
  </code></pre>
  
  <p>but I am not sure how can I remove the last line and save the file.</p>
  
  <p>P.S. given that I use Ubuntu server.</p>