Avatar of gudii9
gudii9
Flag for United States of America asked on

awk commands

awk query
 unzip -c  xyz.log.20180905.gz| awk '$0>= "2013-Sep-09 18:33" && $0 <="2013-Sep-09 23:15"'| grep '|[1-9][0-9][0-9][0-9][0-9]|0000'|wc -l
Zip file too big (greater than 4294959102 bytes)
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
how to learn awk any good video tutorials on it?
please advise
LinuxLinux SecurityLinux NetworkingUnix OSLinux Distributions

Avatar of undefined
Last Comment
ozo

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
ozo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
arnold

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gudii9

ASKER
yes
 unzip

i should have given
gunzip


what is difference between gunzip and zgrep

please advise?
gudii9

ASKER
how gzip different?
arnold

Gzip is a command to compress or decompress
Grep is a command to search for pattern
Zgrep is a fairly recent integration of combining a function to facilitate a way to search for patterns using grep in a compressed archive
zgrep 'pattern' file.gz
Is a combination that previously was
gzip -cd <file.gz | grep 'pattern'


Think of it this way, gzip, grep were a sequence of functional process
Following repeated need, a new single step process, zgrep was developed.
Run ldd zgrep
And what you'll is inclusion of compression related libraries (functions) that are not included in ldd grep.
Your help has saved me hundreds of hours of internet surfing.
fblack61
ozo

man unzip
man gunzip
man zgrep
man awk
should tell you the basics of those commands
the command
file xyz.log.20180905.gz
may help to determine the format of xyz.log.20180905.gz