grep:basic_usage
This is an old revision of the document!
Table of Contents
Grep - Basic usage
Assuming a file exists with the following contents:
boot book booze machine boots bungie bark aardvark broken$tuff robots
Simple Search
grep "boo" filename
returns:
boot book booze boots
NOTE: grep prints out every line that contains the word boo.
Simple Search with Line Numbers
grep -n "boo" filename
returns:
1:boot 2:book 3:booze 5:boots
NOTE: Using the -n option prints includes line numbers.
grep/basic_usage.1598093321.txt.gz · Last modified: 2020/08/22 10:48 by 192.168.1.1