grep—searches a file for a pattern
grep [ –bchilnsvw ] limited–regular–expression [ filename ... ]
grep searches files for a pattern and prints all lines that contain that pattern. Uses regular expressions metacharacters to match the patterns. egrep has an extended set of metacharacters.
Example A.25.
1 grep Tom file1 file2 file3 2 grep -in '^tom savage' * |
EXPLANATION
|
Get UNIX® Shells by Example, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.