Combine multiple unix commands into one output

Posted by Ben McCormack on Server Fault See other posts from Server Fault or by Ben McCormack
Published on 2011-03-08T22:03:07Z Indexed on 2011/03/09 0:12 UTC
Read the original article Hit count: 556

Filed under:
|
|
|

I need to search our mail logs for a specific e-mail address. We keep a current file named maillog as well as a week's worth of .bz2 files in the same folder. Currently, I'm running the following commands to search for the file:

grep [email protected] maillog
bzgrep [email protected] *.bz2

Is there a way combine the grep and bzgrep commands into a single output? That way, I could pipe the combined results to a single e-mail or a single file.

© Server Fault or respective owner

Related posts about linux

Related posts about unix