Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've used this command to find the IP of the server. Can someone explain what the command means? I want to learn.

So far I know: "wget" is a free utility for non-interactive download of files from the Web []

"-O" Writes the documents to File

"-q" quiet (no output)

But why use that "-" in between?

share|improve this question
up vote 4 down vote accepted

The "-O -" means it will write the output to standard output (your console). Generally, you can use "-" as a file with many command line tools to send their output to stdout.

share|improve this answer
Just to be clear stdout is the command line right? – user101699 Dec 22 '11 at 0:49
No, stdout is the normal output pathway which, when you launch a program from the shell, is connected to your terminal/console. – David Schwartz Dec 22 '11 at 1:43
STDOUT is a file descriptor that is used by process to send normal messages to the terminal. It can be redirected with a pipe "|" to be the STDIN for another command. – Mircea Vutcovici Dec 22 '11 at 1:43

Please see the man page for wget, which explains the -O option and the meaning of the hyphen.

-O file


The documents will not be written to the appropriate files, but all will be concatenated together and written to file. If - is used as file, documents will be printed to standard output, disabling link conversion. (Use ./- to print to a file literally named -.)

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.