How to Check if a Directory Exists in Bash?

In the world of Bash scripting, one common task is to check if a directory exists before proceeding with further actions. Whether you are writing automation scripts, performing system maintenance, or managing files and directories, it’s essential to ensure that…