Checking if a directory contains files

Posted by ionn on Stack Overflow See other posts from Stack Overflow or by ionn
Published on 2008-09-18T10:05:52Z Indexed on 2010/03/08 17:06 UTC
Read the original article Hit count: 291

Filed under:
|
|

How do I check if a directory contains files?

Something similar to this:

if [ -e /some/dir/* ]; then echo "huzzah"; fi;

but which works if the directory contains one or several files (the above one only works with exactly 0 or 1 files).

© Stack Overflow or respective owner

Related posts about unix

Related posts about bash