ede*_*dem 16 url bash curl wget download
我可以通过url下载文件但是当我从bash尝试它时,我得到一个html页面而不是文件.
如何使用curl,wget或其他方式下载带有url重定向的文件(301 Moved Permanently)?
UPD
来自网址请求的标头.
HTTP/1.1 301 Moved Permanently
Date: Sat, 07 Dec 2013 10:15:28 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.3.10-1ubuntu3
Location: http://www.somesite.com/files/html/archive.html
Vary: Accept-Encoding
Content-Type: text/html
X-Pad: avoid browser bug
Run Code Online (Sandbox Code Playgroud)
del*_*eil 20
使用-L, --location遵循重定向:
$ curl -L http://httpbin.org/redirect/1
Run Code Online (Sandbox Code Playgroud)