Tester si un repertoire est vide

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

Copy this code and paste it in your HTML
  1. cd /data2/backup/
  3. if [ -z `ls * 2>/dev/null` ]; then
  4. echo "vide"
  5. else
  6. echo "non vide"
  7. fi

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.