3

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?

user101699
  • 153
  • 1
  • 4

2 Answers2

6

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.

devicenull
  • 5,622
  • 1
  • 26
  • 31
1

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

Stefan Lasiewski
  • 23,667
  • 41
  • 132
  • 186