title: How to find a list of jar files that contains a particular class in unix
body: <p>I want to find a list of jar files that contains a given , by searching in a particular directory (DIR) and all its sub directories.</p>
  
  <p>I tried below command. But it provided all the classes that contains the CLASS FILE name. <br>Eg : If the class is <code>Message.class</code>, following command out put the <code>HttpMessage.class</code> like class as well.</p>
  
  <pre><code>find &lt;DIR&gt; -name '*.jar' | while read F; do (echo $F; jar -tvf $F | grep &lt;class&gt;) done - prints the jar name if the class exists then prints the class name.
  </code></pre>