Posted By

mitnworb on 02/22/11


Tagged


Versions (?)

Check if a file exists


 / Published in: Bash
 

  1. FILE="/etc/hosts"
  2. if [ -f $FILE ]; then
  3. echo "File ${FILE} exists"
  4. else
  5. echo "File ${FILE} does NOT exists"
  6. fi
  7.  

Report this snippet  

You need to login to post a comment.