Question about wget -qO-

There is nothing wrong or strange about this.

-qO- is the same as -q (quiet) followed by -O - (output to standard output).

See the wget manual.

The fact that the options are squished together is common Unix practice, and an option that takes an option-argument doesn't usually need a space in-between.

The fact that you're pulling something from the web and feeding it directly into sh should be more of a concern for you.


The following wget and curl commands have the same effect

wget -q -O - https://download.docker.com/linux/ubuntu/gpg

curl -fsSL https://download.docker.com/linux/ubuntu/gpg

You can run it in a Linux terminal to see the result. Basically it's output to system standout stream.

One of the practical examples of these commands are followed by | apt-key add - to add apt-key.

For example,

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

This is equivalent to

wget -q -O -

From man wget, here's what each option means:

-q
--quiet
    Turn of Wget's output.

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

Continuing the description for -O, we see that the mysterious - is just a special symbol used by the -O option to mean standard output:

If ‘-’ is used as file, documents will be printed to standard output, disabling link conversion.

Tags:

Wget