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

标签 curl download wget

从目录下载时是否可以在 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/

相关文章:

javascript - 从 JavaScript 检索 post 请求并将其与 cURL/RCurl 一起使用

bash - 由于 curl 失败,curl 从服务器 bash 返回空回复

javascript - 无法访问 Zomato API JSON 对象

javascript - 如何将 HTML 页面下载为图像?

c - 我如何使用 wget 来获取公钥?

php - Wget 自定义文件名

r - 使用httr和RCurl的415代码,但不仅仅是curl

javascript - 使用 javascript 时从 Shiny 的应用程序下载绘图时出错

html - Ajax 文件下载问题

linux - 可以使用 wget 获取服务器上的所有文件吗?