linux - wget 递归文件夹结构,树中包含多个 index.html 文件

标签 linux command-line wget

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

所以代替:

index.html
contact.html
support.html

我想要:

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

这可以用 wget 实现吗?

最佳答案

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

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

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

关于linux - wget 递归文件夹结构,树中包含多个 index.html 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12252068/

相关文章:

mysql - 如何调整mysql命令行的显示设置?

command-line - 从 XXX 到 utf-8 的字符集转换,命令行

WGET 下载 apache 目录下的特定文件夹

linux - su -session-command 错误

Java Selenium 路径

linux - 如何修复../libcrypto.so : undefined reference to `rc4_md5_enc' ?

linux - 基于 Bash 的热重载实现

apache-flex - 是否可以在 flex 项目的 ActionScript 中检索 swf 元数据?

multithreading - 通过 perl 脚本使用 wget 读取 URL 列表来并行下载网页

bash - 结合wget和grep下载