fgrep—search a file for a character string

fgrep [ –bchilnsvx ] [ –e special string ]
[ –f filename ] [ strings ] [ filename…]

fgrep (fast grep) searches files for a character string and prints all lines that contain that string. fgrep is different from grep(1) and egrep(1) because it interprets regular expression metacharacters as literals. (See grep and grep -F in Chapter 3.)

Example A.25.
1   fgrep '***' *
2   fgrep '[ ] * ? $' filex
				

Explanation

  1. Displays any line containing three asterisks from each file in the present directory. All characters are treated as themselves; i.e., metacharacters are not special.

  2. Displays any lines in filex containing the string enclosed in quotes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.28.108