#curl 命令
有的网址是自动跳转的。使用 -L 参数,curl 就会跳转到新的网址。
#curl -L www.sina.com
-L, --location option or do multiple URL transfers on the same invoke. If the file name is exactly a minus ("-"), curl will instead the contents from stdin.
键入上面的命令,结果自动跳转为 www.sina.com.cn。
#curl -L --output /usr/local/bin/gitlab-runner "https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64"
#-i
参数可以显示 http response 的头信息,连同网页代码一起。
#-I
参数则只显示 http response 的头信息。
#-v
参数可以显示一次 http 通信的整个过程,包括端口连接和 http request 头信息。
#-G
curl -G http://192.168.0.1/gameservice/test?uid=118 & // 不等待返回
#curl http://www.linux.com >> linux.html 保存网页
详细参考: