Answers for "bash how to check if a dir exist"

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
3

if dir bash

if [ -d "$DIRECTORY" ]; then
  # Control will enter here if $DIRECTORY exists.
fi
Posted by: Guest on February-12-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language