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

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

mac终端下载wget

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

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 ,没有理由的额外打字。

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

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。 您可以将版本号更改为其他版本,对吗? 是的,您会的,因为到目前为止,这还不是最新版本。

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

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

mac终端下载wget