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 is mac default shell?

614


What is shell application?

567


Write a script to print the first 10 elements of fibonacci series.

1758


c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and exit on pressing Ctrl-C again

5203


Explain about echo command?

622






What is the first line in a shell script?

553


How do I run a script from command prompt?

560


What is a program shell?

567


Why are shell scripts used?

622


What is the difference between bash and shell?

641


What is web script?

578


Why is the use of shell script?

541


How do I debug a shell script?

558


What are the types of script?

613


Explain about the slow execution speed of shells?

771