title: How does grep run so fast?
body: <p>I am really amazed by the functionality of GREP in shell, earlier I used to use substring method in java but now I use GREP for it and it executes in a matter of seconds, it is blazingly faster than java code that I used to write.(according to my experience I might be wrong though)</p>
  
  <p>That being said I have not been able to figure out how it is happening? there is also not much available on the web.</p>
  
  <p>Can anyone help me with this?  </p>