Archive for August 12th, 2014

Is there a file in that folder?

If you need a script to find if there is a file in a folder or perhaps you are checking for the existence of a file in a specific location.



#!/bin/bash
FILE=”/DIRECTORY/FILENAME”
if [ -f $FILE]; then
echo “Yep that file is there
else
echo “Oh no file with that name found”
fi
exit

Sorted.

August 12, 2014 | By | Reply More