Buy @ Amazon

What is -O- option in wget?

The Quick Answer


  • -O flag is the short notation for the flag --output-document in wget command-line utility.
  • The hypen - after the flag denotes STDOUT.

Thus, wget -O- www.codonomics.com or wget -O - www.codonomics.com prints the result returned  from that URL in your terminal output or STDOUT.

Learn By Example


  • wget -O www.codonomics.com writes the output to index.html file
  • wget -O custom.txt www.codonomics.com writes the output to your custom.txt file as mentioned
  • wget -O - www.codonomics.com writes output to your terminal's STDOUT 

References