Possible Duplicate:
Is there a way in bash to redirect output and still have it go to stdout?
Let's say I do:
ps -ef | grep httpd
to see if apache is running or not, but I also want to "dump" the output of ps -ef
into a file at the same time. Like this:
ps -ef --- grep http
|
--- > file
Is it possible to fork STDOUT in parallel like this? The above is only an example so little hacks like dumping to the file and then grepping the file isn't what I'm looking for.
tee
does! I've only come in contact with it a couple times but thanks for clearing that up. Does it work for the other standard streams? – nopcorn Aug 26 '11 at 20:53