title: Easiest way to check for file extension in bash?
body: <p>I have a shell script where I need to do one command if a file is zipped (ends in .gz) and another if it is not. I'm not really sure how to approach this, here's an outline of what I'm looking for:</p>
  
  <pre><code>file=/path/name*
  
  if [ CHECK FOR .gz ]
  then echo "this file is zipped"
  else echo "this file is not zipped"
  fi
  </code></pre>