How do I pipe a downloaded file to standard output in bash?

Solution 1:

wget -O - -o /dev/null  http://google.com

Solution 2:

Or use curl, where it's the default behaviour.

curl http://www.google.com/

http://curl.haxx.se/


Solution 3:

There are other methods you can use instead of wget and curl:

You can use lynx:

# lynx -source http://www.google.com

w3m:

# w3m -dump_source http://www.google.com

and libwww-perl comes with a handy program called GET (as well has HEAD and POST, which do what you think they do)

# GET http://www.google.com