Question: how to check if directory exists in bash?
Answer: To check if a directory exists in a shell script and is a directory use the following syntax: [ -d "/path/to/dir" ] && echo "Directory /path/to/dir exists."