Commands

  • Many commands support the regular expression syntax, but the most commonly used is the command grep, which is designed to display lines from a file or files matching a given regular expression.

  • There are multiple ways to call grep to change its behavior:

    grep

    Treat the pattern as a basic regular expression.

    egrep

    Treat the pattern as an extended regular expression. Same as grep –E.

    fgrep

    Treat the pattern as a list of fixed strings, any of which may be matched. Same as grep –F.

Get LPI Linux Certification in a Nutshell, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.