Answers for "bash verify folder exists"

10

shell script to check the directory exists

Directory="/opt"
if [ -d "$Directory" ];
then
	echo -e "it's exitsn"
fi
### To check if it's not exists
if [ ! -d "$Directory" ];
then 
	echo -e "It's not theren"
fi
Posted by: Guest on December-31-2020
1

Check is directory exist shell

DIR="/etc/httpd/"
if [ -d "$DIR" ]; then
  # Take action if $DIR exists. #
  echo "Installing config files in ${DIR}..."
fi
Posted by: Guest on June-02-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language