Bash

Bash

check for file or directory exists

if [ -d "directory" ]; then
    echo "directory exists"
fi

if [ ! -d "directory" ]; then
    echo "Directory Exists"
fi