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

posted on 2014-03-18 08:11  leechau  阅读(111)  评论(0编辑  收藏  举报

导航