Question: how to check if a file exists in a directory or not in unix?
Answer: Check if Directory Exist The operators -d allows you to test whether a file is a directory or not. [ -d /etc/docker ] && echo "$FILE is a directory." You can also use the double brackets [[ instead of a single one [ .