Debian コンピュータに Dropbox をインストールしようとしているときに指示がありました。
cd ~ && wget -O - "some website leading to the download of a tar file" | tar xzf -
しかし、私がしたことは、次のように入力しただけでした。
wget -O - "some website leading to the download of a tar file"
ターミナルにゴミが多すぎます。どういう wget -O -
意味ですか?私のコンピュータに損傷を与えますか?
ベストアンサー1
マニュアルページを確認してくださいwget
。
-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 -.)
Use of -O is not intended to mean simply "use the name file instead
of the one in the URL;" rather, it is analogous to shell redirection:
wget -O file http://foo is intended to work like
wget -O - http://foo > file; file will be truncated immediately, and
all downloaded content will be written there.
したがって、次のコマンドを使用して「URL」の内容をファイルにダウンロードするか、-O somefile
その内容をダウンロードしてSTDOUTを介して他のツールにリダイレクトすることで操作を実行できます。この場合、彼らがやっていることはまさにそれです| tar xvf -
。
あなたの命令:
$ cd ~ && wget -O - "some website leading to the download of a tar file" | tar xzf -
tar
上記は「URL」からtarballをインポートし、ダウンロード時にファイルシステムに解凍できるようにコマンドにリダイレクトします。