no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | grep [2014/03/28 22:35] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== grep ====== | ||
+ | * [[ack]] | ||
+ | * [[sed]] | ||
+ | |||
+ | * **-x** - Select only those matches that exactly match the whole line. | ||
+ | |||
+ | == Check if a line exists == | ||
+ | |||
+ | Returns 0 or 1 exit codes | ||
+ | |||
+ | < | ||
+ | cat filelist | grep -xq string | ||
+ | </ | ||
+ | |||
+ | == Return line number == | ||
+ | |||
+ | < | ||
+ | cat filelist -n string | ||
+ | </ |