When try to install dropbox from command line, I read the commands
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
what does -
mean here? is it previous directory?
When try to install dropbox from command line, I read the commands
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
what does -
mean here? is it previous directory?
Some commands accept
-
in place of a filename, either:-
argument passed towget
after-O
is doing.-
argument passed totar
afterxzf
.The command you showed downloads an archive file with
wget
and unpacks it withtar
. To achieve this, the output ofwget
is piped (|
) to the input oftar
. This is whywget
writes to standard output instead of a file andtar
reads from standard input instead of a file.That's just a filename that a lot of Unix programs interpret as "instead of actually opening a file, read from
stdin
(or write tostdout
)."That means reading from the input that gets streamed into the program; in your case, that's the output of wget.
The
-
argument totar
specifies that the archive should be read fromstdin
instead of a file. From the GNU tar manual:Other commands have the same behavior, and it is specified by the POSIX.1-2017 standard: