Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17838

grep help - exact match returns file list

$
0
0

So I need to locate an old email that was corrupted in a recent email outage. I need to match specific date, senders name, and message recipient. The metadata has been damaged so I can't load it back into our mail server.

Using find and grep- I have not found a way to return only a list of files that contain each of the string members I specify. Assistance is greatly appreciated.

grep -rnw '/path/to/files/' -e 'ToName|April 18|FromName|string'

and

find /path/to/files/ | xargs grep "ToName|April 18|FromName|string" -sl

submitted by NathanWasTaken
[link][6 comments]

Viewing all articles
Browse latest Browse all 17838

Trending Articles