What are the additional egrep symbols?
Answers were Sorted based on User's Feedback
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 |
Write a command sequence to find all the files modified in less than 2 days and print the record count of each.
If you have a string "one two three", which shell command would you use to extract the strings?
how to get part of string variable with echo command only?
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.
What is the difference between grep and egrep?
What is the significance of the shebang line in shell scripting?
what is the difference between cmp and diff commands
Is it possible to substitute "ls" command in the place of "echo" command?
How to write a function?
What is an sh file?
What is shell chemistry?
how to separate the even and odd number generated from one file to two separate file i.e. even numbers in file1.txt and odd numbers in file2.txt