Question: how to check if a directory exists in linux command line?
Answer: One can check if a directory exists in a Linux shell script using the following syntax: [ -d "/path/dir/" ] && echo "Directory /path/dir/ exists."