wget - 下载子目录

sur*_*a2k 39 wget

如何使用wget仅下载子目录?我可以指定需要下载的子目录吗?

谢谢!

Aam*_*mir 69

你可以做:

wget -r -l1 --no-parent http://www.domain.com/subdirectory/

哪里:

-r: recursive retrieving
-l1: sets the maximum recursion depth to be 1
--no-parent: does not ascend to the parent; only downloads from the specified subdirectory and downwards hierarchy
Run Code Online (Sandbox Code Playgroud)

  • 感谢您分解命令参数.我有类似的问题,但只需要-r和--no-parent命令. (4认同)
  • 此外,添加 `-nd` 以将文件直接保存在当前目录中,而无需 /path/to/the/subdirectory。 (3认同)
  • 如果您想确保每个页面都可以正确加载(即:下载页面上加载的图像),则可以在上述命令中添加** -p **标志。 (2认同)

Kar*_*mai 10

$ wget -m -p -E -k -K -np {URL Address}
Run Code Online (Sandbox Code Playgroud)

您可以使用手册页获取选项的详细信息.

注意:使用以前的选项,将下载文件索引!

  • ** - m**:适用于镜像的选项,如无限递归和时间戳** - p**:page-requisites** - E**:adjust extension** - k**:转换本地查看链接**-K**:备份原创,不要破坏** - np**:没有父母 (3认同)
  • 疯狂的。正是我正在寻找的。这应该是公认的答案。 (2认同)