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 [http://linux.about.com/od/commands/l/blcmdl1_wget.htm]

"-O" Writes the documents to File

"-q" quiet (no output)

But why use that "-" in between?

link|improve this question
feedback

2 Answers

up vote 3 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.

link|improve this answer
Just to be clear stdout is the command line right? – user101699 Dec 22 '11 at 0:49
1  
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
feedback

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

-O file

--output-document=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 -.)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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