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 syntax of "grep" command?

Answers were Sorted based on User's Feedback



What is the syntax of "grep" command?..

Answer / jayachandran.g.r

syntax of "grep" command


syntax: grep {word to lookup} {filename}



Ex: grep man test

Is This Answer Correct ?    29 Yes 6 No

What is the syntax of "grep" command?..

Answer / satchi

Grep is a filter used for pattern matching in shell script.

It searches for the patern if file name is give, or else it
will look for the input data using pipe(|)

Syntax:

1. Grep <patern to search> <Filename>
2. cat <filename> | grep <Patern to search.>

we can use -i option to ignore case sensitiveness.There are
so many options available.you have to explore that.

Is This Answer Correct ?    18 Yes 4 No

What is the syntax of "grep" command?..

Answer / vasanth

grep: Find lines in a file that match a regular expression

syntax: grep [options] pattern [files]

Useful Options : -v, -l, -L, -c, -n, -b, ,-i

-v Print only lines that donot match the regular expression
-l Print only names of files that contains matching
lines,not the line themseleves

for furthur information
pls ref. linux pocket guide by Daniel J. Barrett (page-71)

Is This Answer Correct ?    14 Yes 4 No

What is the syntax of "grep" command?..

Answer / kaustubh

grep command is a utility which helps in searching pattern
from the given file.

example

grep "pattern" /home/username/somefile.txt

it ll search all lines in the file somefile.txt and will
print the line which contains pattern.

there are many options as
-v = invert
-i = ignorecase
-c = count
-l = filename
-r = recursive

Is This Answer Correct ?    7 Yes 6 No

Post New Answer

More Shell Script Interview Questions

How can I Debug a shell scripts and Perl scripting?? or How do you debug a shell scripting and perl scripting ( at the compile time error or run time error) in Unix environment ?

4 Answers  


What is the syntax of "grep" command?

4 Answers  


What is wc in shell script?

0 Answers  


How to create environment variables?What are the conditions for creating variables?

1 Answers   Infosys, Wipro,


Explain about the exit command?

0 Answers  


What does egrep mean?

0 Answers  


What is mac default shell?

0 Answers  


What is the best shell scripting language?

0 Answers  


What are the advantages of shell scripting?

0 Answers  


What is the first line in every perl script called?

0 Answers  


Determine the output of the following command: name=shubham && echo ‘my name is $name’.

0 Answers  


What is the use of "test" command?

2 Answers  


Categories