title: Code for extracting from the right side with cut command?
body: <p>There is a sample of using the <code>cut</code> command to extract parts of a string starting from the left. An example is given below.</p>
  
  <pre><code>$ echo "abc-def-ghi-jkl" | cut -d- -f-2
  abc-def
  </code></pre>
  
  <p>How can the same code be adapted to extracting from the right side? I thought of reversing the words and applying the same method, but it was too complicated.</p>