DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

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



Published

Aug 27, 2013

Last Updated

Aug 27, 2013

Category

Tech

Tags

  • shell 46

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor