gpt4 book ai didi

curl - 在 wget 或curl 查询中使用通配符

转载 作者:行者123 更新时间:2023-12-01 19:17:44 31 4
gpt4 key购买 nike

从目录下载时是否可以在 wget 查询中使用通配符?基本上,我有一个网站,例如 www.download.example.com/dir/version/package.rpm。然而,版本目录一直在变化,有时包含多个RPM包。是否有一个 wget 查询只能获取我以及 version 目录中的所有包,而不知道该版本是什么?在我的理想世界中,查询将类似于:

wget www.download.example.com/dir/*/*.rpm

如果有一种方法可以使用 curl 来做到这一点,那也可以。

最佳答案

您不能在 wget 中使用通配符,但 -A 标志应该可以使用。来自 wget manpage :

You want to download all the gifs from a directory on an http server. You tried wget http://www.server.com/dir/*.gif, but that didn't work because http retrieval does not support globbing. In that case, use: wget -r -l1 --no-parent -A.gif http://www.server.com/dir/

编辑:找到 related question

关于目录:

有一个名为 LFTP 的实用程序,它对通配符有一定的支持。看看manpage 。还有一个question on Linux & Unix这涵盖了它在与您类似的场景中的用法。

关于curl - 在 wget 或curl 查询中使用通配符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18107236/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com