title: Get first file of given extension from a folder
body: <p>I need to get the first file in a folder which has the <code>.tar.gz</code> extension. I came up with:</p>
  
  <pre><code>FILE=/path/to/folder/$(ls /path/to/folder | grep ".tar.gz$" | head -1)
  </code></pre>
  
  <p>but I feel it can be done simpler and more elegant. Is there a better solution?</p>