Wget -A 按扩展名和文件名过滤 - 应该仅按扩展名

发布于 2024-11-16 19:14:44 字数 303 浏览 6 评论 0原文

我正在尝试从 Maven 存储库下载所有 JAR 文件。

我输入:

wget -A jar -r http://mirrors.ibiblio.org/pub/mirrors /maven2/

它只遍历文件名中包含 jar 的目录,例如“FindJar”,并跳过其余所有目录。

它应该遍历所有目录,直到找到要下载的 jar 文件。

为什么它不能那样工作???

I am trying to download all JAR files from the Maven repository.

I type:

wget -A jar -r http://mirrors.ibiblio.org/pub/mirrors/maven2/

It only traverses directories with jar in the filename like "FindJar" and skips all the rest.

It should be traversing all directories until it finds a jar file to download.

Why is it not working that way???

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

妳是的陽光 2024-11-23 19:14:45

执行 -A *.jar 而不是 -A jar,这样 wget 将查找所有带有 .jar 后缀的文件,而不是名为 的文件罐子

do -A *.jar instead of -A jar so wget will look for all files with .jar suffix instead of files named jar.

空‖城人不在 2024-11-23 19:14:44

请改用 FTP 访问:

wget -A jar -m -l inf ftp://mirrors.ibiblio.org /maven2/

这仍然会创建maven网站/ftp站点的目录层次结构。

如果您想下载所有内容而不重新创建子目录,则可以在 URL 前添加 -nd 。这意味着“没有目录”。

wget -A jar -m -l inf -nd ftp://mirrors.ibiblio.org/maven2/

Use FTP access instead:

wget -A jar -m -l inf ftp://mirrors.ibiblio.org/maven2/

This will still create the directory hierarchy of the maven website / ftp site.

If you want to download everything without recreating the subdirectories then you can add -nd before the URL. This means "no directories".

wget -A jar -m -l inf -nd ftp://mirrors.ibiblio.org/maven2/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文