使用-c
标志,我可以告诉wget
恢复下载。wget
然后将查询预先存在的文件的大小以告诉服务器从哪里恢复下载。
有没有办法告诉wget
从任意偏移量开始,即相当于curl
的-C
选项?
我知道我总是可以手动创建一个具有正确大小的文件,将新数据附加到其中,然后删除前缀,但这样做非常麻烦。
答案1
从 1.16 版开始,--start-pos
。来自手册页:
--start-pos=OFFSET Start downloading at zero-based position OFFSET. Offset may be expressed in bytes, kilobytes with the `k' suffix, or megabytes with the `m' suffix, etc. --start-pos has higher precedence over --continue. When --start-pos and --continue are both specified, wget will emit a warning then proceed as if --continue was absent. Server support for continued download is required, otherwise --start-pos cannot help. See -c for details.
对于 1.16 之前的 wget 版本,此选项不可用。