Find + zgrep covers only last 3 days

250 Views Asked by At

I'm having a problem with find and zgrep commands. Here's the full command I try to use:

find ~/xyz/server*/p* -mtime -14 -type f | xargs zgrep -h "qq/ww/ee/calendar\|qq/ww/ee/flights"

What I'm trying to achieve is zgrep (as the files are in .gz) a pattern qq/ww/ee/calendar or qq/ww/ee/flights from directory ~/xyz/server1/p* and ~/xyz/server2/p* (file names begin with p) that were modified/created within last 14 days.

The problem I'm having is that despite the fact that the above find command works flawlessly if used alone, when I add xargs zgrep to it it only gives me results from last 3 days.

Before you ask - yes, the files are there. And please bear in mind that I'm rather new to this world.

0

There are 0 best solutions below