Questions tagged [zgrep]
6 questions
2
votes
0 answers
Search text in zipped files and move them to other folder
Friends, On my Mac, I have 100s of zip files in a directory named Test. Let's assume I have files a.zip,b.zip,c.zip....... Now I want to grep all files for a text "searchText" and move the matching files to another folder. I am trying this:
$for…
Nirav Shah
- 21
2
votes
1 answer
Grep with string comparison: return only lines "higher than" a timestamp
I have an email log file which records when an email went out, and who to. This gets logrotated and so there are a mixture of zipped and unzipped log files going back a week or so.
I'm currently (successfully) getting back all lines matching a…
Max Williams
- 3,129
1
vote
1 answer
Would the performance of this `grep` or `zgrep` command benefit from more memory, or from a faster CPU?
I have the following commands:
time grep -F -f 'in2.txt' test.fastq
time zgrep -F -f 'in2.txt' test.fastq.gz
There are about 30 search terms on files with ~5 GB. However I notice that on one computer it takes over 3-5x time to finish searching,…
ahdee
- 11
- 2
0
votes
1 answer
How to use different options at same search with Zgrep
How may I use zgrep to search for A where B is missing.
Like:
-v This option is used to display the lines which doesn’t have the expression present in it.
tried:
zgrep "search_for_this" | zgrep -v "where_this_is_missing file.json.gz
didn't…
PlayHardgoPro
- 171
0
votes
1 answer
Want to find a string with in all subdirectories in a folder
Suppose i'm in a folder
/data/
The folder data contains 10 other folders
/data/temp1
/data/temp2
/data/temp3
and so on
all of which have .gz files in them , i.e temp1 , temp2 , temp3 till temp10 all contain .gz files in them
I want to be able to…
0
votes
1 answer
Perform operations on the output of find command with -exec options
I want to perform operations on the files found by the find command which already has a -exec option.
find . -type f -exec zgrep -li "4168781103" {}…