Wget output document and headers to STDOUT

前端 未结 5 840
失恋的感觉
失恋的感觉 2020-12-22 18:30

I\'m trying to output the document body and its headers to STDOUT by doing

wget -S -O - http://google.com

...but it shows only the HTML docum

5条回答
  •  太阳男子
    2020-12-22 19:08

    This will not work:

    wget -q -S -O - google.com 1>wget.txt 2>&1
    

    since redirects are evaluated right to left, this sends html to wget.txt and the header to STDOUT:

    wget -q -S -O - google.com 2>&1 1>wget.txt
    

提交回复
热议问题