<p>From a shell script, how do I check if a directory contains files?</p>

<p>Something similar to this</p>

<pre class="lang-sh prettyprint-override"><code>if [ -e /some/dir/* ]; then echo "huzzah"; fi;
</code></pre>

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

Try:
```
```
if [ ! -z `ls /some/dir/*` ]; then echo "huzzah"; fi
```
```