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)
Check Out this Related Man Page
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)
I have a huge file that I want to grep for the following:
the word "SEVERE" and today's month and date (Nov 16)
I then want to send the results of this grep to someone using mailx, as an atachment.
My question is how can I do this in one single line?
Thanks in advance. (18 Replies)
Hey guys:
I've been meaning to post this question for awhile...it is regarding grep. Let's say for example that the following entry is in logxx:
Wed Feb 2 07:44:11 <vsm> 91030 Line 5 Severity 1 Vps 6
Call Answered - DN:8753101 CLID:5164665761 PI:83
If I do a grep 91030... (27 Replies)
I have a script that sorta works the way I want but I would rather
just get the base name and line number from the grep output.
My current script is this one liner:
grep -n "$1" $SCCSPATH/*/s.*.k | cut -c1-80
which if I was searching for 121197 I would get something like this:
... (18 Replies)
Hi all
I am in a small problem pl help me out.
I am having a directory having ZIP files with name starting as :
01.xyz
02.pqr
and so on
I want to run the script-
cat myfile | awk '{print $1, $2}' | while read var1 var2
do
zcat $var2* | grep "^000$var1" >> my_output
done
Where the... (22 Replies)
Hi
Currently I can grep a log file with the following command:
$results = `grep -A 2 '^$date.$time.*' $log`;
and the following arguments:
$date = 2007/04/25
$time = 16:07
Log example:
2007/04/25 16:07:12.145701
2007/05/25 14:07:12.145701
2007/05/25 17:07:12.145701
2007/06/25... (37 Replies)
Hi ,
I used the floowing command in my script.
grep 'swi' file.txt | grep '^DEV' | cut -f 6 >> f.txt
Here file.txt contains fields of records.
My intension is to grep for the 3 letter 'swi' in one of filed, this field will contain swi as part of word.
And next grep is to grep for a 'DEV'... (18 Replies)
I am wondering if there is a way via grep and sed to extract a string that is on the 2nd line below a known marker as in this example:
TextRel 203 0 0 "WELL:"
SetPosAbs 1287 -6676
TextRel 210 0 0 "AEP #2"
The marker is WELL:, but the string I need is "AEP #2". Can grep/sed handle this... (19 Replies)
Hello guys - I am new to Unix.
I am trying to understand how to grep a perticular string in todays file?
I am trying this syntax but not getting what I am looking for:
% grep `date '+%d/%b/%Y'`
For instance there are 2 files generated today with same data. I am trying to find them and... (21 Replies)
Hi guys,
I'm rather new at using UNIX based systems, and when it comes to scripting etc I'm even newer.
I have two files which i need to compare.
file1: (some random ID's)
451245
451288
136588
784522
file2: (random ID's + e-mail assigned to ID)
123888 xc@xc.com
451245 ... (21 Replies)
Here is my code. What it does is it reads an input file (input.txt which contains roughly 2,000 search phrases) and searches a directory for files that contains the search phrase. The directory contains roughly 1900 files and 84 subdirectories. The output is a file (output.txt) that shows only the... (23 Replies)
Hi folks...
Relatively new to scripting, but really struggling with something that will no doubt be second nature to most people on here:
Trying to get an exact match on $sub, where sub is an ip address.
subnet ()
{
clear
while true
do
... (18 Replies)
I've got at least 30,000 XML files that I'm using the grep command to get their filename. Can I use the head command to grab just the beginning 8 lines and compare that instead of parsing the whole document? It would speed things up! or maybe grep -m? (49 Replies)
Hello Everyone!
I have updated the first post so that my intentions are easier to understand, and also attached sample files (post #18).
I have over 500 text files in a directory. Over 1 GB of data. The data in those files is organised in lines:
My intention is to return one line per... (23 Replies)
Hello
I am using a grep command with two patterns in my KSH script. File has line breaks in it and both the patterns are in different lines. Here is the command grep -l 'RITE AID.*ST.820' natriter820u.20140914
Pattern1 - RITE AID
Pattern2 - ST*820
I am not getting any results from... (24 Replies)
Hi,
I am printing the children of a process using this command:
ps -aef | grep 13783 | grep -v grep | grep -v ps | grep -v $0
and it shows the children correctly. (2 in my case)
The thing is that when I pipe it to awk to get the PIDs like this:
ps -aef | grep 13783 | grep -v grep |... (19 Replies)