Skip to main content

Questions tagged [zgrep]

Questions about zgrep, a front end to grep and that allows you to search inside gzipped files using regular expressions.

-1votes
1answer
125views

zgrep command not working correctly on command substitution [duplicate]

I am preparing a script that will try to detect two texts on the same line.  This pattern is present in my application log files, which then further used to identify which file contains the pattern. ...
Piyush Nikhade's user avatar
0votes
3answers
116views

How to add column based in the second line match using SED or another command?

I have the following lines result from zcat command 1 - URL Template: https://www.test.com 2 - Response: <200 OK,{Server=[nginx], Date=[Wed, 11 May 2022 01:05:06 GMT], Content-Type=[text/html; ...
user13737800's user avatar
0votes
0answers
194views

How to ignore errors in zgrep reader?

I want to search a directory's contents for a certain string on Ubuntu, and output all files that contain it. Problem: if zgrep tries to read a damaged file, the process stops: zgrep -n 'test' /var/...
membersound's user avatar
2votes
2answers
13kviews

How to run zgrep with multiple AND patterns?

I know how to do it with grep, but the command doesn't work with zgrep grep -E 'Pattern1.*Patter2' fileName I'm using zgrep to match patterns inside a .json.gz file. Because the files are too big, I ...
PlayHardgoPro's user avatar
1vote
1answer
2kviews

Zgrep command is not working

I need to search "335664324" in the file A33256.xml.gz. I tried the following code. sftp> zgrep -c "335664324" A33256.xml.gz A33256.xml.gz Invalid command. I'm in the same ...
Shehan's user avatar
0votes
2answers
195views

How to extract few tabs from a xml file using zgrep or sed

I have a big size file like 5GB with .gz. Inside that file, we have few XML files that contains values that I want to search and extract just in case if those values are there. For example I want to ...
Juan Pablo Bustamante Luna's user avatar
3votes
1answer
2kviews

Fastest way to find lines starting with string in gzip file

I have a flat database based on 65536 files, each one containing one word by line starting with two hexadecimal characters. They look like this: afword 46word2 Feword3 ... I make tens of thousands of ...
James's user avatar
1vote
1answer
1kviews

zgrep a column and print the matching filename

I am trying to match pattern for a particular column in the thousands of gzipped files on a Linux machine, and based on the match I want to print the file name how to do that. Below options are not ...
Forever Learner's user avatar
0votes
0answers
264views

xargs with zgrep is giving the error

I have many gzipped files and I am trying to find some string pattern from the thousands of file but I am getting extra .gz while trying to zgrep it. Please refer the below, could you please advise. ...
Forever Learner's user avatar
1vote
3answers
2kviews

Slow performance of zgrep in multiple files

I have a 9.8GB gzip file A.gz and other file i have is 79MB B.txt which has some text in each line. I want to grep B's text in A.gz and write to a new file. Initially, I used this command zgrep -f B....
happy's user avatar
0votes
3answers
961views

zgrep for multiple pipe symbols in a bunch of gz files

I have a lot of .gz files in a folder /a/b/c1.gz /a/b/c2.gz /a/b/c3.gz and so on. Some of the files have a single pipe delimiter, some have two, three and four and so on, in such a way: xyz|abc xyz|...
Sicario007's user avatar
0votes
0answers
190views

Anyway to provide hint to zgrep to search part of file for faster search results

Production logs file are huge in size and are stored in compressed format. I use the following to find specific log line zgrep searchString LargeLogFiles*.gz Typically this takes huge amount of ...
mtk's user avatar
  • 28.4k

close