利用curl查看网页头部信息Linux认证考试
文章作者 100test 发表时间 2009:12:08 20:47:32
来源 100Test.Com百考试题网
  命令行如下:
  curl -I http://www.google.cn
  HTTP/1.1 200 OK
  Date: Fri, 04 Dec 2009 05:00:48 GMT
  Expires: -1
  Cache-Control: private, max-age=0
  Content-Type: text/html. charset=GB2312
  Set-Cookie: PREF=ID=b967a5569e7612fe:NW=1:TM=1259902848:LM=1259902848:S=RzTnMbkx10_w1Fo3. expires=Sun, 04-Dec-2011 05:00:48 GMT. path=/. domain=.google.cn
  Set-Cookie: NID=29=jSJmgVmzh8Tj9yXNQI_obR5bbG8wIOk2J_8A8fzeSTYuUalXTkC7vv8rZNAgcy2YAvZ0TaGnfrj3HlJMSP3i9qolrNNjSiwt2ZNQ-5vl9yOYGswZYq70c8MtBxr2Lw3c. expires=Sat, 05-Jun-2010 05:00:48 GMT. path=/. domain=.google.cn. HttpOnly
  Server: gws
  X-XSS-Protection: 0
  Content-Length: 0
  发现在其服务器名被修改为gws
  curl -I http://www.baidu.com
  HTTP/1.1 200 OK
  Date: Fri, 04 Dec 2009 04:55:44 GMT
  Server: BWS/1.0
  Content-Length: 3520
  Content-Type: text/html.charset=gb2312
  Cache-Control: private