Check Directory Existence in Shell

The following command in one line can check if a directory exists. You can check the return value ("yes or "no) then decide what to do.

$ if [ -d /home/gcp/deploy ] ; then echo "yes" ; else echo "no" ; fi

原文地址:https://www.cnblogs.com/darkmatter/p/3606806.html