What is the syntax of "grep" command?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

State the advantages of shell scripting?

845


What is the equivalent of a file shortcut that we have a window on a linux system?

844


Where are cowrie shells found?

785


What is the conditional statement in shell scripting?

917


what is info area how many types?

2518


Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.

2053


What does it mean to debug a script?

808


What is an sh file?

755


What is the fastest scripting language?

755


How can you get the value of pi till a 100 decimal places?

766


How do I run a script from command prompt?

782


Why is a script important?

768


What is sh in shell script?

782


I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?

985


Explain about the exit command?

768