How do I loop through a directory? I know there is for f in /var/files;do echo $f;done; The problem with that is it will spit out all the files inside the directory
for f in /var/files;do echo $f;done;
A simple loop should be working:
for file in /var/* do #whatever you need with "$file" done
See bash filename expansion