818

/ tmp /cron_test/にファイルをダウンロードする必要があります。私のwgetコードは

wget --random-wait -r -p -nd -e robots=off -A".pdf" -U mozilla http://math.stanford.edu/undergrad/

では、ディレクトリを指定するためのパラメータはありますか?

4

5 に答える 5

1112

マニュアルページから:

-P prefix
--directory-prefix=prefix
           Set directory prefix to prefix.  The directory prefix is the
           directory where all other files and sub-directories will be
           saved to, i.e. the top of the retrieval tree.  The default
           is . (the current directory).

-P /tmp/cron_test/したがって、コマンドに(短い形式)または--directory-prefix=/tmp/cron_test/(長い形式)を追加する必要があります。また、ディレクトリが存在しない場合は作成されることに注意してください。

于 2009-07-03T09:23:23.373 に答える
557

-Oダウンロードするファイルのパスを指定するオプションです。

wget <uri> -O /path/to/file.ext

-Pディレクトリ内のファイルをダウンロードする場所のプレフィックスです。

wget <uri> -P /path/to/folder
于 2015-07-28T05:23:35.303 に答える
0

man wget: -O file --output-document=file

wget "url" -O /tmp/cron_test/<file>
于 2018-01-11T20:02:58.530 に答える