title: Delete last word in each line in bash
body: <p>I am trying to go through a file, and delete the last word in each line. Currently, I am using the command </p>
  
  <pre><code>sed 's/^*\n//' old.txt &gt; new.txt
  </code></pre>
  
  <p>but it is coming out that old.txt is the same as new.txt. Thanks for any help, and let me know if I can clarify the question. Also, in order to define 'word' I am just using spaces.</p>