What is the syntax of "grep" command?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What command needs to be used to take the backup?

775


What is a file basename?

814


I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?

1907


What is the crontab?

757


Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.

1937


What does sh mean?

819


What is the first line of a shell script called?

816


What is bourne shell scripting?

754


What is echo $shell?

832


Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.

952


What are the different types of commonly used shells on a typical linux system?

782


What is shell scripting?

798


What's the difference between scripting and coding?

832


What language is bash?

667


What is the fastest scripting language?

758