Finding text with grep
You can search through multiple files for specific strings of characters and then view the resulting list of matching files onscreen. You do this using the grep command (which stands for "global regular expression print"), as shown in Code Listing 6.7. As we'll show you in the following steps, you can add several flags to grep to get slightly different results.
To find text strings with grep:
1. | grep bucket limericks |
2. | grep -5 bucket limericks |
Get Unix: Visual QuickStart Guide 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.