grep examples

Find lines in files containing some search query

Basic example

Given there is a file with a name someFile in the current directory and the someFile file contains a line with findMe text:

A file `someFile` contains a line with `findMe` text
A file `someFile` contains a line with `findMe` text

Executing the command:

grep findMe someFile

gives the result:

grep command execution result
grep command execution result