wget递归文件夹结构,树中有多个index.html文件

时间:2012-09-03 17:37:01

标签: linux command-line wget

默认情况下,wget -r将目录下载为directoryname.html。我希望它下载到directoryname / index.html

所以而不是:

index.html
contact.html
support.html

我想:

index.html
contact/index.html
support/index.html

这与wget有关吗?

1 个答案:

答案 0 :(得分:2)

当我想镜像我使用的网站时:

$ wget -m -E -nH -np --cut-dirs=2 http://site/a/b/

这样就可以下载目录“b”下的所有内容。如果您的目标目录处于不同的级别,则需要相应地调整--cut-dirs。