I recently wrote a script to watermark all of the image files in a directory. Most of the images I use on this website are PNG files, but I occasionally use JPGs. The challenge in my script was to find all of the image files in the directory regardless of image type.
After a bit of web research I discovered the file command. The file command takes a list of files as input and outputs the file names along with file type. Continue reading