What is the syntax of "grep" command?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is web script?

819


Is shell scripting difficult?

730


What is k shell?

754


What does egrep mean?

765


What is shift command in shell script?

764


What is a scripting language simple definition?

842


What is .sh file in mac?

789


What are the different communication commands available in the shell?

753


How to pass an argument to a script?

822


How does shell scripting work?

887


How do I run a .sh file on mac?

925


Is shell a scripting language?

798


What is shell application?

773


i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..

1979


What is the significance of the shebang line in shell scripting?

808