Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the use of "grep" command?

Answer Posted / kiran sangeri

grep is one of many standard UNIX utilities. It searches
files for specified words or patterns. First clear the
screen, then type
% grep science science.txt
As you can see, grep has printed out each line containg the
word science.
Or has it ????
Try typing
% grep Science science.txt
The grep command is case sensitive; it distinguishes
between Science and science.
To ignore upper/lower case distinctions, use the -i option,
i.e. type
% grep -i science science.txt
To search for a phrase or pattern, you must enclose it in
single quotes (the apostrophe symbol). For example to
search for spinning top, type
% grep -i 'spinning top' science.txt
Some of the other options of grep are:
-v display those lines that do NOT match
-n precede each matching line with the line number
-c print only the total count of matched lines

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?

1268


What is $0 bash?

1143


What is the behavioural difference between cmp and diff commands?

1220


Write a command that will find all text files in a directory such that it does not contain the word "amazing" in any form (that is, it must include the words amazing, amazing, or amazing)?

1522


What does the command ' $who | sort –logfile > newfile' do?

1245


How can we use grep command in unix?

1152


How do I search for text in vi?

999


What do chown command do?

1124


Are you in or at the office?

1084


What does #!/ Bin sh do?

1034


What is the command to compare two files in unix?

1062


What does touch command do in unix?

1355


Enumerate some of the most commonly used network commands in unix?

1118


What is the use of sed command in unix?

1154


What is the difference between awk and grep?

1159