title: bash script read all the files in directory
body: <p>How do I loop through a directory? I know there is <code>for f in /var/files;do echo $f;done;</code> The problem with that is it will spit out all the files inside the directory all at once. I want to go one by one and be able to do something with the $f variable. I think the while loop would be best suited for that but I cannot figure out how to actually write the while loop. </p>
  
  <p>Any help would be appreciated.</p>