Grep is one of the most usefull tool in linux or unix. With grep you can extract lines that correspond to certain criteria.
The most basic way to use grep is the following :
Syntax
grep <string> <file name>
Let suppose a file name “name” that contain the name of people.
Here is what it contain:
Dany Moore
Steve Hawkins
Roger Hipkiss
Loy Hinton
Mandy Moore
Candy Diaz
Fernando Diaz
if you do :
1
Grep Moore name
you will get :
Dany Moore
Mandy Moore