grep Getting started with grep Basic usage


Example

Running the command:

grep sam someFile.txt

When someFile.txt contains:

fred 14 m foo
sam 68 m bar
christina 83 f baz
bob 22 m qux
Sam 41 m quux

Will produce this output:

sam 68 m bar