Random Shell Script

Welcome to the random shell script of the week! This shell script is trivial but useful, especially if you don’t write this kind of stuff every other day. The following shell script will iterate over every file in the current directory and print the filename out.

#!/bin/sh

for file in ./*
do
   echo "$file"
done

You can modify the ./* to ./*jar to loop through all jar files.