title: Unix: How to sort a dat file and keep original line numbers
body: <p>I have a large data file containing over a thousand entries. I would like to sort them but maintain the original line numbers. For instance,</p>
  
  <pre><code>1:100
  2:120
  3:10
  4:59
  </code></pre>
  
  <p>Where the first number is the line number, not saved in the data file, separated by a colon from the real number. I would like to sort it and keep the line numbers bound to their original lines, with an output of:</p>
  
  <pre><code>2:120
  1:100
  4:59
  3:10
  </code></pre>
  
  <p>If possible, I would like to do this without creating another file, and numbering them by hand is not an option for the data size I'm using.</p>