title: How does grep work?
body: <p>I am trying to understand how <code>grep</code> works. </p>
  
  <p>When I say <code>grep "hello" *.*</code>, does <code>grep</code> get 2 arguments &mdash; (1) string to be searched i.e. "hello" and (2) path <code>*.*</code>? Or does the shell convert <code>*.*</code> into something that <code>grep</code> can understand?</p>
  
  <p>Where can I get source code of <code>grep</code>? I came across this <a href="http://www.gnu.org/s/grep/devel.html">GNU <code>grep</code></a> link. One of the README files says its different from <code>unix grep</code>. How so?</p>
  
  <p>I want to look at source of FreeBSD version of <code>grep</code> and also Linux version of it (if they are different).</p>