03-16-2013
You must tell which version you are using and let's check if your OS supports grep -A and grep -B supports.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have a .txt file
Sample:
=====================
NEXT HOST
=====================
AEADBAS001
ip access-list extended BLA_Incoming_Filter
ip access-list extended BLA_Outgoing_Filter
access-list 1 permit xxxxxxxxxxxxxx
access-list 2 permit xxxxxxxxxxxxxx
=====================... (4 Replies)
Discussion started by: I-1
4 Replies
2. Shell Programming and Scripting
Hi
I have a text file which has two sets of lines repeating for "n" number of times.Some data is printed between the two lines.I want to retrieve all the data thats there in between those two set of lines.I have the string value of those two set of lines.
To be much more clearer
... (4 Replies)
Discussion started by: chennaitomcruis
4 Replies
3. UNIX for Dummies Questions & Answers
are there any basic commands that can display lines 99 - 101 of the /etc/passwd file?
I'm thinking use of head and tail, but I forget what numbers to use and where to put /etc/passwd in the command. (2 Replies)
Discussion started by: raidkridley
2 Replies
4. Shell Programming and Scripting
Hi,
I am checking if a file exists or not and based on the result I am sending an email. The email part works fine but the content of the email comes in a single line and I am not able to display it in diferent lines.
if ; then
echo "Hi, \\n An exception exists in the process.... (3 Replies)
Discussion started by: shanth_chandra
3 Replies
5. UNIX for Dummies Questions & Answers
cat is the normal unix command to display the content of a file.
Is there any program to display the content of the file.
If there is, then can you send me the code. (5 Replies)
Discussion started by: vedanjalig
5 Replies
6. UNIX Desktop Questions & Answers
well, i am so not familiar with this kind of things but i am gonna explain extactly what i am looking for so hopfully someone can figure it out :)
i have a command that shows memory usage besides the process name, for example(the command output):
500 kb process_1
600 kb process_2
700 kb... (4 Replies)
Discussion started by: Portabello
4 Replies
7. Shell Programming and Scripting
Am using the following grep to match a particular patter in grep.
grep xyz abc.txt
now while i run this command, if the pattern matched, am getting the line containing xyz
Output: xyz is doing some work
Now if i want the file name also along with my output, what should i do
Expected... (2 Replies)
Discussion started by: rituparna_gupta
2 Replies
8. UNIX for Dummies Questions & Answers
This could be a really dummy question.
I have a log text file.
What unix command to extract line from specific string to another specific string.
Is it something similar to?:
more +/"string" file_name
Thanks (4 Replies)
Discussion started by: aku
4 Replies
9. Shell Programming and Scripting
Dear Gurus,
I'm in a strange situation, hence need some kind of advice or possible syntax to carry on.
let's say current time/date is 2013-12-18, 15:58:15
I got a file something like this, which keep getting updated with respect to time.
2013-12-18,... (4 Replies)
Discussion started by: manas_ranjan
4 Replies
10. Shell Programming and Scripting
cat file1
*FileHeader* Partition 0
Total Data Bytes 1416
Avg Bytes/Record 1416
Others 1
PRDX22.AUDIT_DATA_INFO Partition 4
Total Data Bytes 4615
Avg... (8 Replies)
Discussion started by: Veera_V
8 Replies
ZGREP(1) General Commands Manual ZGREP(1)
NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)
ZGREP(1)