check if exist folders or not shell code example
Example 1: linux shell check if directory does not exists
if [ ! -d directory ]; then
mkdir directory
fi
Example 2: Check is directory exist shell
DIR="/etc/httpd/"
if [ -d "$DIR" ]; then
# Take action if $DIR exists. #
echo "Installing config files in ${DIR}..."
fi