title: ps pipe to grep brackets grep keyword.
body: <p>A lot of times when I use ps and pipe it into grep, I put one of the grep characters in [ ] square brackets. I do this do the actual call to grep is not included in the ps readout. It helps when I am scripting. Like if I redirect the output to a file, and that file is empty, the process I am looking at is not on. I do not know why bracketing one character of the grep works, and was amused to see that using the brackets is actually faster and takes less processing time. </p>
  
  <pre><code>-bash-3.2$ time ps -ef | grep *.[j]il
  
  real    0m0.027s
  user    0m0.012s
  sys     0m0.017s
  
  -bash-3.2$ time ps -ef | grep *.jil
  zksuy7k  11528 18285  0 20:54 pts/7    00:00:00 grep *.jil   
  
  real    0m0.040s
  user    0m0.015s
  sys     0m0.016s
  -bash-3.2$
  </code></pre>