4

On my website I have a text file with data on it (The site in question is hosted by GoDaddy, so I can't access the file locally). This file is updated through PHP. From the Unix/Linux/Mac bash I would like to get the contents of the text file so I can use it in scripts. Any help would be appreciated :)

4

2 回答 2

15

curl已安装在您的 Mac 上,因此您无需安装它。您还会发现curl安装在几乎任何 Linux 发行版上。这可能是你最安全的选择。

cd ~/Desktop
curl www.google.com >> google.txt

wget可以使用Homebrew轻松安装在您的 Mac 上。它可能已经安装在大多数 Linux 发行版上。

cd ~/Desktop
wget www.google.com
于 2013-01-19T22:35:33.093 回答
3

Install MacPorts and install wget:

$ sudo port install wget

And then:

$ wget http://godaddy.com/somewhere/somefile.txt

And the resulting text file will be somefile.txt (this can be changed using the -O option).

于 2013-01-19T22:32:45.740 回答