Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How is it possible to pipe out wget's downloaded file? If not what alternatives should I use?

UPD: Thanks all for your answers, I managed to tune my downloader (curl) to send files to stout. However the files I'm receiving are zipped and I'm now struggling to unzip them on the fly. If you have an idea how to do that in Linux, please see

share|improve this question

5 Answers 5

up vote 25 down vote accepted
wget -O - -o /dev/null
share|improve this answer
The -o /dev/null is only necessary if you truly don't care about errors, since without that errors will be written to stderr (while the file is written to stdout). – Greg Hewgill Jun 15 '09 at 11:03
right. or you can check error codes... as long as you pipe output to a file not another command. – pQd Jun 15 '09 at 11:23
AFAIK, no need to -o /dev/null because that goes to stderr anyway. – Milan Babuškov Jun 15 '09 at 11:27
You can use wget -qO- $URL to simplify things. – Oli Jul 5 '11 at 12:04
wget -qO- $URL works if you're using Wget on Windows – Chris S Jan 27 '12 at 12:29

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


share|improve this answer
-s won't hurt to make it quiet, particularly with a small file. – A-B-B Oct 6 '14 at 22:54

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

You can use lynx:

# lynx -source


# w3m -dump_source

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

share|improve this answer
Offtopic, but I've used lynx in some of my scripts to parse html for me automatically whenever I've needed the content of a page and didn't care about the markup. It's great for that – Matt Simmons Jun 15 '09 at 12:46
indeed, both lynx and w3m have a -dump option. I prefer w3m for its table and frame support. – David Pashley Jun 15 '09 at 14:00

Just to add another option: I often use lwp-request, from libwww-perl, for this. It outputs to STDOUT by default and is more likely than curl to be installed on the systems I use (your situation my vary).

share|improve this answer

This is how I did it:

curl -s "$URL" | egrep -o "[^']+" | xargs wget -qO-
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.