zgrep result searching resulting

zgrep -C5 'xyz' abc.gz

i have above grep
in the results how to search on say "error code=1111 description=null pointer"


Above results too large i am not able to copy paste to notepad++ (which i usually do makes easy to to my eyes) to search on like error code=1111 description=null pointer"

zgrep -C5 'xyz' abc.gz >>/home/TestUser/testuser.txt

can we do tail or head on above?
please advise
LVL 7
gudii9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Likely because your abc.gz file is corrupt.

Post output of this command...

file abc.gz

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Also just try this...

gzip -d abc.gz

Open in new window

Murali SripadaCommented:
zgrep -C5 'xyz' abc.gz >>/home/TestUser/testuser.txt | less (or) | head should work fine.. I have not tested the tail part ..
nociSoftware EngineerCommented:
Use this
zgrep -C5 'xyz' abc.gz >>/home/TestUser/testuser.txt

Open in new window

to generate a file and look at at your leissure it using:

less /home/TestUser/testuser.txt

Open in new window

(within less you can look search for the next occurence of some error code  with  f.e.
/code=
gudii9Author Commented:
zgrep -C5 'xyz' abc.gz >>/home/TestUser/testuser.txt

above worked now when i change to below directory i can see that .txt file

/home/TestUser/
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.