如何用wget指定下载位置? [英] How to specify the download location with wget?
本文介绍了如何用wget指定下载位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将文件下载到/tmp/cron_test/.我的 wget 代码是
I need files to be downloaded to /tmp/cron_test/. My wget code is
wget --random-wait -r -p -nd -e robots=off -A".pdf" -U mozilla http://math.stanford.edu/undergrad/
那么是否有一些参数来指定目录?
So is there some parameter to specify the directory?
推荐答案
来自手册页:
-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/
(长格式)你的命令.另请注意,如果该目录不存在,则会创建该目录.
So you need to add -P /tmp/cron_test/
(short form) or --directory-prefix=/tmp/cron_test/
(long form) to your command. Also note that if the directory does not exist it will get created.
这篇关于如何用wget指定下载位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文