[在Mac OS中使用终端下载文件(带有重定向URL)

问题描述 投票:0回答:1

需要一点帮助。

URL1。https://download.mozilla.org/?product=firefox-esr-latest-ssl&os=osx&lang=en-US

URL2。https://download-installer.cdn.mozilla.net/pub/firefox/releases/68.7.0esr/mac/en-US/Firefox%2068.7.0esr.dmg

在浏览器上,URL1重定向到URL2以下载Firefox ESR。我可以使用第二个URL下载文件,但不能与URL1一起使用。

curl -o〜/ Downloads / Temp / Firefox.dmg https://download-installer.cdn.mozilla.net/pub/firefox/releases/68.7.0esr/mac/en-US/Firefox%2068.7.0esr.dmg

请提出建议。

谢谢,迪帕克

macos terminal scripting
1个回答
0
投票

您需要:

curl -L FirstURL -o myfile

长格式:

curl --location https://google.com --output myfile

© www.soinside.com 2019 - 2024. All rights reserved.