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)
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)
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)
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)
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)
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)
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)
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)
As an exercise, I'm trying to re-write this code without the compound square brackets, using grep and test. Need to know what to do about the "equal-tilde".
#!/bin/bash
# test-integer2: evaluate the value of an integer.
INT=-5
if +$ ]]; then
if ; then
echo "INT is zero."
else
if ; then... (17 Replies)