Grep family -- searching for patterns

  1. grep -- print lines matching a pattern
    • -i -- ignore case.  Match pattern without checking case.
    • -v -- show everything except what immediately follows the option
    • -R, -r -- Recusive.  Check all files under a directory
    • -E -- extended grep.  Interpret a pattern as a regular expression.
    • -F --fixed-strings.  Interpret a pattern as a list of fixed strings, separated by new-lines, any of which is to be matched.
  2. egrep -- Same as grep -E
  3. fgrep -- Same as grep -F
  4. Using either egrep or fgrep is deprecated.  It is provided to allow historical applications that rely on them to run unmodified.  In other words, those older scripts that system administrators wrote using egrep or fgrep will run without have to edit the script and substitute grep -E for egrep and grep -F for fgrep.  (Most system administrators will edit the script sooner than later, simply because they don’t want to deal with troubleshooting a script after it fails.)