0

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.

Barmar
  • 741,623
  • 53
  • 500
  • 612
boberczus
  • 3
  • 4
  • Can you give us the output for the `find` command and then the output for the full command you are using? – Kind Stranger Jul 09 '17 at 17:11
  • Perhaps something which shows us the modification times of these files too – Kind Stranger Jul 09 '17 at 17:36
  • Maybe none of the older files match the pattern – Barmar Jul 09 '17 at 17:54
  • SO is for programming questions, not questions about using or configuring Linux. SuperUser.com or unix.stackexchange.com would be better places for questions like this. – Barmar Jul 09 '17 at 17:56
  • Case solved. I wasn't notified that the log structure has changed recently and URL path is a bit different for these older files. Oh well, at least I've learned something new. Thanks guys, and thanks for sites recommendations. – boberczus Jul 09 '17 at 20:06

0 Answers0