Posted in  File Manipulation, Grep  on  January 15, 2015 by  Stephane Morin0 comments
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
Or you can do :

2

cat name | grep Moore

And still get the same result!

About the Author

Stephane Morin

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Sign up for more great content!

>