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.

4 votes
1 answer
223 views

I've noticed that zgrep and zless are not working in Buildroot 2025.05. I managed to fix zgrep by adding a symlink from /usr/bin/grep to /bin/grep. zless is a script and I suspect the issue is that ...
frank's user avatar
  • 41
-1 votes
3 answers
159 views

I want to find out in which of my 1200 *.gz files a certain IP address occurs on a certain date (17.07.2025). I could not find the IP address in my current logs: grep 'IP address' *.logs My attempt ...
fl1tz's user avatar
  • 1
-1 votes
1 answer
163 views

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
0 votes
3 answers
125 views

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
0 votes
0 answers
215 views

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
2 votes
2 answers
15k views

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
1 vote
1 answer
2k views

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
  • 11
0 votes
2 answers
214 views

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
3 votes
1 answer
2k views

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
  • 71
1 vote
1 answer
2k views

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
0 votes
0 answers
286 views

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
1 vote
3 answers
3k views

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
  • 63
0 votes
3 answers
999 views

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
0 votes
0 answers
201 views

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.6k