How find and grep command to find target file?

General support questions
Post Reply
kevinnksk
Posts: 1
Joined: 2022/08/26 16:33:31

How find and grep command to find target file?

Post by kevinnksk » 2022/08/26 17:24:14

I am using postfix on my email server, there all emails are CC to backup email accounts (this email account around have 500000 emails). one day, a user missed an email on his own account. I am trying to use the find command to search the email. But the result is a failure. Because the file is not the type. "1587957568.M818437P5474.mail.xxxxx.com,S=1443199,W=1462001:2,S"

My target is to find out Apr to Aug all send/receive emails from kiowong and copy them to the user cur file directory

command is
find ./ -type f -exec grep -H -R "kiowong@xxxxx.com" {} \;

find ./ -type f -exec grep -H -R "kiowong@xxxxx.com" -exec cp -a {} \;

File List
Maildir.jpg
Maildir.jpg (177.8 KiB) Viewed 1400 times
Output result
result.jpg
result.jpg (119.01 KiB) Viewed 1400 times

Post Reply