2012-09-18

Bash Shell: Check if a file exists, and has a size larger than 0

To check, whether a file exists and has a file size larger than 0 use this expression:



if [ -s someFile.txt ]
then
  ...
fi

No comments:

Post a Comment