Previous Section  < Day Day Up >  Next Section

4.10. Fixed grep (grep –F and fgrep)

The fgrep command behaves like grep, but does not recognize any regular expression metacharacters as being special. All characters represent only themselves. A caret is simply a caret, a dollar sign is a dollar sign, and so forth. With the –F option, GNU grep behaves exactly the same as fgrep.

Example 4.51.

% fgrep '[A-Z]****[0-9]..$5.00' file      or

% grep -F '[A-Z]****[0-9]..$5.00' file


EXPLANATION

Finds all lines in the file containing the literal string [A–Z]****[0–9]..$5.00. All characters are treated as themselves. There are no special characters.

    Previous Section  < Day Day Up >  Next Section