grep:basic_usage
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
grep:basic_usage [2020/08/22 10:55] – 192.168.1.1 | grep:basic_usage [2020/08/22 11:02] (current) – 192.168.1.1 | ||
---|---|---|---|
Line 114: | Line 114: | ||
This is useful if you are searching through multiple files for the same string. | This is useful if you are searching through multiple files for the same string. | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Ignore Case ===== | ||
+ | |||
+ | <code bash> | ||
+ | grep -i " | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Exact Matches Only ===== | ||
+ | |||
+ | <code bash> | ||
+ | grep -x " | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | The result in this example will print nothing, because there are no lines that only contain the pattern **boo**. | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Add additional lines of context ===== | ||
+ | |||
+ | <code bash> | ||
+ | grep -A2 " | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | machine | ||
+ | boots | ||
+ | bungie | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | In this example 2 additional lines. | ||
+ | </ | ||
+ | |||
grep/basic_usage.1598093746.txt.gz · Last modified: 2020/08/22 10:55 by 192.168.1.1