![无法让 wget -np -nH 不下载父目录](https://linux22.com/image/1610317/%E6%97%A0%E6%B3%95%E8%AE%A9%20wget%20-np%20-nH%20%E4%B8%8D%E4%B8%8B%E8%BD%BD%E7%88%B6%E7%9B%AE%E5%BD%95.png)
我尝试过 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 /到我的位置