mac终端下载wget_如何使用Wget从终端下载PHP源代码

在Mac终端中从PHP镜像站点下载文件时,由于重定向导致默认文件名为' mirror'。解决方法是在wget命令中使用'-O'参数指定文件名。例如,输入wget -O php-5.5.14.tar.gz http://example.com/php源代码链接,即可将文件保存为php-5.5.14.tar.gz。记得根据需要更改版本号。
摘要由CSDN通过智能技术生成
mac终端下载wget

mac终端下载wget

Downloading files from the PHP mirrors is annoying, because by default the redirector makes the name of the filename change to just “mirror.” So how do you fix this? Luckily wget has a simple argument that you can use to fix it — and it is useful for many scenarios.

从PHP镜像下载文件很烦人,因为默认情况下,重定向器会将文件名更改为“ mirror”。 那么如何解决这个问题? 幸运的是,wget有一个简单的参数,您可以使用它来修复它-在许多情况下它很有用。

Whenever you want to force the output from the Wget command into a specific filename, you just need to use the -O argument (that’s a capital letter o), or the longer version, --output-document=FILE that is a lot of extra typing for no reason.

每当您想将Wget命令的输出强制转换为特定的文件名时,您只需要使用-O参数(即大写字母o),或者使用更长的版本– --output-document=FILE ,没有理由的额外打字。

So to force PHP to download as a specific filename, you would use something like this:

因此,要强制PHP以特定的文件名下载,您将使用如下代码:

wget -O php-5.5.14.tar.gz http://us.php.net/get/php-5.5.14.tar.gz/from/this/mirror

wget -O php-5.5.14.tar.gz http://us.php.net/get/php-5.5.14.tar.gz/from/this/mirror

That line would save the resulting download file from the mirror link to the filename php-5.5.14.tar.gz. You would change the version number for a different version, right? Yes, you would, because that isn’t even the latest version as of this moment.

该行会将生成的下载文件从镜像链接保存到文件名php-5.5.14.tar.gz。 您可以将版本号更改为其他版本,对吗? 是的,您会的,因为到目前为止,这还不是最新版本。

翻译自: https://www.howtogeek.com/194160/how-to-download-php-source-from-the-terminal-with-wget/

mac终端下载wget

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值