How can I gzip standard in to a file and also print standard in to standard out?

Posted by Ross Rogers on Stack Overflow See other posts from Stack Overflow or by Ross Rogers
Published on 2009-02-20T19:49:11Z Indexed on 2010/04/27 1:03 UTC
Read the original article Hit count: 446

Filed under:
|
|
|

I want to execute a command, have the output of that command get gzip'd on the fly, and also echo/tee out the output of that command.

i.e., something like:

echo "hey hey, we're the monkees" | gzip --stdout > my_log.gz

Except when the line executes, I want to see this on standard out:

hey hey, we're the monkees

© Stack Overflow or respective owner

Related posts about linux

Related posts about bash