When writing a Bash script, it is common that you’ll run into the need to check for the existence of a directory. Based on the result, your Bash script can proceed with the appropriate action.
This is a companion discussion topic for the original entry at https://linuxconfig.org/bash-scripting-check-if-directory-exists