How do I grep a string in a file?

How do I grep a string in a file?
Answer
The following are examples of how to use the grep command:
  1. To search in a file named pgm.s for a pattern that contains some of the pattern-matching characters *, ^, ?, [, ], …
  2. To display all lines in a file named sort.c that do not match a particular pattern, type the following: grep -v bubble sort.c.
 

Tìm kiếm

Back
Top