how to grep messages of user test of a specific date
# tail -f /var/log/mail |grep "test"
Jul 3 12:16:02 tiger postfix/local: 036A23178E: to=<test@tiger>, orig_to=<test>, relay=local, delay=1, status=sent (delivered to mailbox)
shows all the messages related to user "test",
but I need to ADD another condition..the "date", i.e I need to grep messages of user test *but only of the specific date*
I did the following
# tail -f /var/log/mail |grep "test" |grep "Jul 2"
no results ;(
need to redirect messages related to user test on June 29 on a separate file.. following also doesn't works.
grep test /var/log/mail |grep "Jun 29" >/logs/test_mail_on_JUN29.txt
grep test /var/log/mail |grep "Jun 29" - >/logs/test_mail_on_JUN29.txt