Grep

  • Grep's default: search inside each line
  • Common grap flags
    Idea Flag Meaning
    eXact -x Recognize entire line
    Count -c Count the number of matches
    Number -n Give line numbers 1...
    reVerse -v Give us the lines that don't match
    Whole Word -w The pattern must be surrounded by space
    List -l List file names that contained a match

    e.g. grep -x b[1-5]c\* myfile.txt

  • [:cntrl:] - control characters like \n and ^L and ^M (the line breaks). See "man grep" for details.