Check if a folder exists

/ Published in: Bash
Save to your folder(s)

Copy this code and paste it in your HTML
  1. DIR="/etc"
  2. if [ -d $DIR ]; then
  3. echo "Folder ${DIR} exists"
  4. else
  5. echo "Folder ${DIR} does NOT exists"
  6. fi

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.