title: Loop through all the files with a specific extension
body: <pre><code>for i in $(ls);do
      if [ $i = '*.java' ];then
          echo "I do something with the file $i"
      fi
  done
  </code></pre>
  
  <p>I want to loop through each file in the current folder and check if it matches a specific extension. The code above doesn't work, do you know why? </p>