无法让 wget -np -nH 不下载父目录

无法让 wget -np -nH 不下载父目录

我尝试过 6 次不下载父目录,但都失败了。有人能就我的标记错误给出建议吗?

torify wget -r -N --no-parent -R "index.html*" -nHhttp://somewebsite/Dir_a/Dir_b/Dir_c/-P /到我的位置

我只成功删除了根目录,但仍然得到父目录 /Dir_a/Dir_b/

当我只想要 Dir_c 和里面的所有文件时。

我正在使用 unix、zshell、torify、wget。

是什么赋予了?

答案1

我有时会很固执,无法放手。终于找到了我的问题。我需要添加 --cut-dirs=<#>,其中 <#> 是要省略的顶级目录数。因此正确的命令最终是:

torify wget -r -N --no-parent -R“index.html*”-nH --cut-dirs=2http://somewebsite/Dir_a/Dir_b/Dir_c/-P /到我的位置

相关内容