What are the additional egrep symbols?

Answers were Sorted based on User's Feedback



What are the additional egrep symbols?..

Answer / vijesh

-b Precede each line by the block number on which
it was
found. This can be useful in locating block
numbers by
context (first block is 0).

-c Print only a count of the lines that contain
the pat-
tern.

-e pattern_list
Search for a pattern_list (full regular
expression
that begins with a -).

-f file
Take the list of full regular expressions from
file.

-h Suppress printing of filenames when searching
multiple
files.

-i Ignore upper/lower case distinction during
comparis-
ons.

-l Print the names of files with matching lines
once,
separated by NEWLINEs. Does not repeat the
names of
files when the pattern is found more than once.

-n Precede each line by its line number in
the file
(first line is 1).

-s Work silently, that is, display nothing except
error
messages. This is useful for checking the
error
status.

-v Print all lines except those that contain the
pattern.


-x Consider only input lines that use all
characters in
the line to match an entire fixed string or
regular
expression to be matching lines.

Is This Answer Correct ?    0 Yes 0 No

What are the additional egrep symbols?..

Answer / chandramohan

egrep -v

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Shell Script Interview Questions

Calculate a real number calculation directly from the terminal and not any shell script.

0 Answers  


There are three departments A,B and C.Write a query to display the names of all the persons( in departments other than A) who are paid higher than the person receiving the lowest salary in DEPT A

1 Answers   Wipro,


What will happen to my current process when I execute a command using exec?

0 Answers  


What is the significance of $#?

0 Answers  


What is a shell script in windows?

0 Answers  






State the advantages of shell scripting?

0 Answers  


on “sed” command EmpData(Sample Database) 1122|j.b. saxena |g.m. |account |12/12/52|6000 2233|n.k. gupta |d.g.m |sales |31/12/40|9000 4545|anil agarwal |director |account |06/07/47|7500 5656|lalit choudhury |executive|marketing|07/09/50|5000 1265|chanchal singhvi|g.m. |admin |12/09/63|6000 0110|shyam saksena |chairman |marketing|12/12/43|8000 5566|jai sharma |director |account |23/12/89|7000 7733|jayant |d.g.m |sales |29/02/70|6000 1. From the above database substitute the delimiter of first 3 lines with “ : “ 2. From the above database substitute the delimiter with “ : ” 3. Insert the string “ XYZ Employees” in the first line. 4. Store the lines pertaining to the directors, d.g.m and g.m into three separate files. 5. Using address store first 4 lines into a file Empupdate. 6. Find the pattern “account” in the database and replaces that with “accounts”. 7. Select those lines which do not have a pattern “g.m”. 8. Insert a blank line after every line in the database.

0 Answers  


c program to check whether all the directories in the path exists has read and write permission

1 Answers  


c program which accept one argument as a directory name and prints all the file name along with its inode number and total count of the file in directory

1 Answers  


How do you read arguments in a shell program - $1, $2 ..?

4 Answers  


what is info area how many types?

0 Answers  


How do I run a .sh file?

0 Answers  


Categories