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

6 Answers 6

wget -O - -o /dev/null  http://google.com
  • 13
    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). Jun 15, 2009 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, 2009 at 11:23
  • AFAIK, no need to -o /dev/null because that goes to stderr anyway. Jun 15, 2009 at 11:27
  • 12
    You can use wget -qO- $URL to simplify things.
    – Oli
    Jul 5, 2011 at 12:04
  • 1
    wget -qO- $URL works if you're using Wget on Windows
    – Chris S
    Jan 27, 2012 at 12:29

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

curl http://www.google.com/


  • 4
    -s won't hurt to make it quiet, particularly with a small file.
    – Asclepius
    Oct 6, 2014 at 22:54

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

You can use lynx:

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


# 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
  • 1
    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 Jun 15, 2009 at 12:46
  • indeed, both lynx and w3m have a -dump option. I prefer w3m for its table and frame support. Jun 15, 2009 at 14:00

This is how I did it:

curl -s "$URL" | egrep -o "http://downloads.wordpress.org/plugin/[^']+" | xargs wget -qO-

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).

  • 1
    FWIW, Mac OS has curl (not wget) and I believe other BSD's do as well. As do a lot of embedded *nix systems I've used. Not sure if Perl is more common than curl.
    – Wyatt Ward
    Feb 2, 2016 at 21:18

I suggest to use Aria2. It's powerful downloader.

aria2c http://google.com.tw

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .