How do I grep a string in a file?
Answer
The following are examples of how to use the grep command:
Answer
The following are examples of how to use the grep command:
- To search in a file named pgm.s for a pattern that contains some of the pattern-matching characters *, ^, ?, [, ], …
- 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.