ZGREP(1) BSD General Commands Manual ZGREP(1)NAME
zgrep, zegrep, zfgrep -- print lines matching a pattern in gzip-compressed files
SYNOPSIS
zgrep [grep-flags] [--] pattern [files ...]
zegrep [grep-flags] [--] pattern [file ...]
zfgrep [grep-flags] [--] pattern [file ...]
DESCRIPTION
zgrep runs grep(1) on files or stdin, if no files argument is given, after decompressing them with zcat(1).
The grep-flags and pattern arguments are passed on to grep(1). If an -e flag is found in the grep-flags, zgrep will not look for a pattern
argument.
zegrep calls egrep(1), while zfgrep calls fgrep(1).
EXIT STATUS
In case of missing arguments or missing pattern, 1 will be returned, otherwise 0.
SEE ALSO egrep(1), fgrep(1), grep(1), gzip(1), zcat(1)AUTHORS
Thomas Klausner <wiz@NetBSD.org>
BSD December 28, 2003 BSD
for secure access purposes I want to know where somebody logs in
working in K shell
I have
who am i= giving user and terminal =gxb pts/4 Jan 22 15:0
finger user => gives all sessions of user
=
Login name: gxb
Directory: /home/gxb ... (17 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)
This isn't working for multiple files. It works for one file though.
exists1=$(ls | grep gspp*)
for FILES in $exists1
do
echo "Loading $exists1"
... (23 Replies)
Hello, im trying to grep the first 3 lines(starting with ERROR) from an output report and put it in a separate file... any help would be appreciated. Below is the message contained in the report
ERROR >Invalid basic data (CMOFCT-5070)
Cusip: 05950XAL0 CMO#508039 Tra# 11 rec# 175
Firts Int... (15 Replies)
I want to write a command to search in a list of files, the files that contain a pattern for a number of times between Min and Max
But I don't know how to do it.
Can anyone give me advice? (26 Replies)
grep for a particular pattern and remove 5 lines above the pattern and 6 lines below the pattern
root@server1 # cat filename
Shell Programming and Scripting test1
Shell Programminsada asda
dasd asd Shell Programming and Scripting Post New Thread
Shell Programming and S sadsa ... (17 Replies)
Dear experts,
i want to search pattern tre and copy this line and above two lines
in a seperate file::
Thanks for the help
SEV="MAJOR": RX-TX HW-FAILURE DOMAIN="alcomc2_BSS_20
unit-type % bts nbr % 24
SBL-type % tre nbr % 4 subnb % 255
BR,
Danish (16 Replies)
Hi all,
i have a script called a.sh and within a.sh it calls b.sh.
when i do a ps -ef | grep a.sh, i get two sets of number
user_test 4225 3250 0 10:31 pts/1 00:00:00 a.sh
when i do a ps -ef | grep b.sh, i get two sets of number
user_test 4269 4225 22 10:31 pts/1 00:00:45... (17 Replies)
hey every1, i am a very new shell programmer. what i am trying to do is to rename a music file using its metadata(using mminfo)
the problem is, mminfo's output is very weird:
my final filename should be "$artist - $title"
however, when i use
artist=` mminfo ~/Desktop/It\'s\ Not\ My\... (16 Replies)
Hi friends,
I have data in tab separated file with headers like this :
*sml1 *sml3 *smln7 smfk9 smllf56...
Which shell command I should use if i want to extract entire columns that have header names beginning with "*" ? i want to copy these columns into another file.
Thanks, (14 Replies)
Hi,
I want to search multiple patterns in a variable.
DB_ERR=`echo "$DB_TRANS" | grep "SP2-" | grep "ORA-"`
echo $DB_ERR
But I am not getting anything in DB_ERR.
I want to print each line on seperate line. Could you please help me out in this. Thanks in advance. (14 Replies)
I was wondering if it was possible to grep a pattern based on the surround text. For example, if i have an input file like this:
titleA
titleB
titlex
titleC
titleD
titlex
titleE
And I want to grep "title" and save the results only if it is not followed with a "titlex". My output... (14 Replies)
Hello folks i have file which is below, i want to extract last column of file that contains dm-21 or dm-13 or dm-N
it show output like
I have tried but i got this (16 Replies)
Hi,
Im using the below command to search a file for multiple expressions if the 4th expression doesnt exist the command simply lists what it can find and ignores what it cant. Is there any way to get the command to output an error or a message if it cant find the 4th expression to a file?
... (16 Replies)