Bash check if a directory exists

How to find if a directory exists in bash:

DIR="/etc"
if [ -d $DIR ]; then
echo "Folder ${DIR} exists"
else
echo "Folder ${DIR} does NOT exists"
fi


Posted

in

by

Tags:

Comments

Leave a Reply