Grep searches for basic regexps per default. Use -E to use extended regexps, use -F to search for fixed strings.

  • -v: Invert search
  • -i: Case insensitive search
  • -c: Just count the number of results (instead of piping to wc -l)

Examples

Delete header lines from sam files: grep -v “^@” infile.sam