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 happens when you type ls?

752


Is powershell a language?

766


What is sh in shell script?

749


What is basename in shell script?

799


What is eval in shell script?

891


How do I stop script errors?

774


How does ls command work?

783


Write a shell script to get current date, time, user name and current working directory.

849


How do you create a shortcut in linux?

801


What are the disadvantages of shell scripting?

846


What is another name for a bash shell script that you might see?

1218


What is $1 in shell scripting?

798


What is shell and shell script?

782


What are the different types of shell scripting?

762


‎What is a shell? · ‎Types of shell · ‎what is shell scripting?

757