Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag 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
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

yes
 unzip

i should have given
gunzip


what is difference between gunzip and zgrep

please advise?
Avatar of gudii9

ASKER

how gzip different?
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.
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