如何使用Linux中的WGET下载多个文件,并使用每个下载文件的自定义名称保存它们

发布于 2025-01-22 17:45:51 字数 133 浏览 1 评论 0原文

如何使用WGET下载多个文件。假设我有一个包含多个URL的URL.TXT,我想使用每个文件的自定义文件名自动保存它们。如何做?

我尝试使用此格式“ WGET -C url1 -o filename1”下载1乘1,现在我想尝试下载批次下载。

How to download multiple files using wget. Lets say i have a urls.txt containing several urls and i want to save them automatically with a custom filename for each file. How to do this?

I tried downloading 1 by 1 with this format "wget -c url1 -O filename1" successfully and now i want to try do batch download.

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

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

发布评论

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

评论(2

呆萌少年 2025-01-29 17:45:51

您可以看一下 /a>命令,您需要准备每个wget呼叫的参数的文件,以便假设它被命名为download.txt

-O file1.html https://www.example.com
-O file2.html https://www.duckduckgo.com

然后使用它

cat download.txt | xargs wget -c

如下做

wget -c -O file1.html https://www.example.com
wget -c -O file2.html https://www.duckduckgo.com

You might take look at xargs command, you would need to prepare file with arguments for each wget call, lets say it is named download.txt and

-O file1.html https://www.example.com
-O file2.html https://www.duckduckgo.com

and then use it as follows

cat download.txt | xargs wget -c

which is equivalent to doing

wget -c -O file1.html https://www.example.com
wget -c -O file2.html https://www.duckduckgo.com
夜无邪 2025-01-29 17:45:51

添加输入文件和一个循环:

for i in `cat urls.txt`; do wget $i -O filename-$i; done

Add the input file and a loop:

for i in `cat urls.txt`; do wget $i -O filename-$i; done
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文