grep 'pattern' file.txt

Category: Text Processing

grep 'pattern' file.txt

Search for a pattern in a file

Searches a file for lines matching a pattern and prints them. grep stands for 'Global Regular Expression Print'.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.