 <p>I am not sure you are asking for this.</p> <p>If the path of the folders are same you can use <code>-or</code> with <code>find</code></p> <p><code>find $CATALINA_HOME/webapps/myapp/WEB-INF/lib/ -name "*.jar" -or -type d</code></p> <p><code>-type d</code> will also find directories</p>