CGREP(1) General Commands Manual CGREP(1)NAME
cgrep - grep and display context
SYNOPSIS
cgrep [-a n] [-b n] [-f] [-l n] [-n] [-w n] pattern [file] ...
OPTIONS -a How many lines to display after the matching line
-b How many lines to display before the matching line
-f Suppress file name in the output
-l Lines are truncated to this length before comparison
-n Suppress line numbers in the output
-w Sets window size (same as -a n -b n)
EXAMPLES
cgrep -w 3 hello file1
# Print 3 lines of context each way
DESCRIPTION
Cgrep is a program like grep, except that it also can print a few lines above and/or below the matching lines. It also prints the line
numbers of the output.
SEE ALSO grep(1), fgrep(1).
CGREP(1)
Check Out this Related Man Page
GREP(1) General Commands Manual GREP(1)NAME
grep - search a file for lines containing a given pattern
SYNOPSIS
grep [-elnsv] pattern [file] ...
OPTIONS -e-e pattern is the same as pattern
-c Print a count of lines matched
-i Ignore case
-l Print file names, no lines
-n Print line numbers
-s Status only, no printed output
-v Select lines that do not match
EXAMPLES
grep mouse file # Find lines in file containing mouse
grep [0-9] file # Print lines containing a digit
DESCRIPTION
Grep searches one or more files (by default, stdin) and selects out all the lines that match the pattern. All the regular expressions
accepted by ed and mined are allowed. In addition, + can be used instead of * to mean 1 or more occurrences, ? can be used to mean 0 or 1
occurrences, and | can be used between two regular expressions to mean either one of them. Parentheses can be used for grouping. If a
match is found, exit status 0 is returned. If no match is found, exit status 1 is returned. If an error is detected, exit status 2 is
returned.
SEE ALSO cgrep(1), fgrep(1), sed(1), awk(9).
GREP(1)
I have a history file that recieves all sorts of messages 24 hours a day. I have a script that retreives various messages in the history file. There is an one multi line output that is sent to the history file that comes in every 15 minutes. How do I cgrep for the most recent 15 minute output in... (5 Replies)
Hi,
New to this forum. Nice forum and very helpful.
Quick question. I'm trying to grep a list of numbers from single digit to 3-digit. For example, I have a pool of numbers that contain two specific numbers, 17 and 177. I would like to grep for 17 but not get 177. When using grep, I also... (4 Replies)
Hi All,
Please find the sample file below:
NAME ID NUMBER
-------------------------------------------------------------------------------------------------- ---------
abcdefgheija;lksdf ... (13 Replies)
How do you grep 'select * from table_name' string from a script if the select * and from table_name are on 2 different lines ? like
select *
from table_name
Any help would be greatly appreciated !!!
Thanks
RDR (4 Replies)
Hi all,
I have been searching all over Google but I am unable to find a solution for a particular result that I am trying to achieve.
Consider the following input:
1
2
3
4
5
B4Srt1--Variable-0000
B4Srt2--Variable-1111
Srt
6
7
8
9
10
End (3 Replies)