wget 활용 - 헤더정보 보기, 파일을 다운로드 하여 특정이름으로 저장

* 윈도우용 wget : wget.exe

C:> wget –spider -S http://www.naver.com –> 헤더정보를 console에 뿌린다.
–15:04:28–  http://www.naver.com/
           => index.html' <br>Resolving www.naver.com... done. <br>Connecting to www.naver.com[202.131.30.82]:80... connected.&nbsp; <span style="background-color: rgb(255, 255, 255); color: rgb(51, 102, 255); font-weight: bold; font-family: '바탕','Batang';"><span style="background-color: rgb(255, 255, 255); color: rgb(51, 204, 0);">--&gt; IP는 </span><span style="background-color: rgb(255, 255, 255); color: rgb(51, 204, 0);">202.131.30.82 </span><span style="background-color: rgb(255, 255, 255); color: rgb(51, 204, 0);">다.</span></span> <br>HTTP request sent, awaiting response... <br>&nbsp;1 HTTP/1.1 200 OK <br>&nbsp;2 Date: Fri, 30 Nov 2007 06:04:21 GMT&nbsp;&nbsp; <span style="background-color: rgb(255, 255, 255); color: rgb(51, 102, 255); font-weight: bold; font-family: '바탕','Batang';"><span style="background-color: rgb(255, 255, 255); color: rgb(51, 204, 0);">--&gt; 메인페이지는 오늘 아침 6시 4분 21초에 업데이트 되었다.</span></span> <br>&nbsp;3 Server: <span style="background-color: rgb(255, 255, 255); color: rgb(51, 102, 255); font-weight: bold;">Apache <span style="background-color: rgb(255, 255, 255); color: rgb(51, 204, 0); font-family: '바탕','Batang';">--&gt; Naver는 메인페이지용 웹서버로 Apache를 쓰고 있다</span></span> <br>&nbsp;4 Cache-control: no-cache, no-store, must-revalidate <br>&nbsp;5 Pragma: no-cache <br>&nbsp;6 P3P: CP="CAO DSP CURa ADMa TAIa PSAa OUR LAW STP PHY ONL UNI PUR FIN COM NAV INT DEM STA PRE" <span style="background-color: rgb(255, 255, 255); color: rgb(51, 102, 255); font-weight: bold; font-family: '바탕','Batang';"><span style="background-color: rgb(255, 255, 255); color: rgb(51, 204, 0);">--&gt; P3P를 쓰고 있다</span></span> <br>&nbsp;7 Connection: close <br>&nbsp;8 Content-Type: text/html; charset=euc-kr&nbsp; <span style="background-color: rgb(255, 255, 255); color: rgb(51, 102, 255); font-weight: bold; font-family: '바탕','Batang';"><span style="background-color: rgb(255, 255, 255); color: rgb(51, 204, 0);">--&gt; 캐릭터셋으로 euc-kr로 쓰고 있다.</span></span> <br>200 OK <br> <br>C:\&gt; <span style="background-color: rgb(255, 204, 102);">wget -O good.jpg http://www.hikr.org/files/33971.jpg<span style="background-color: rgb(255, 255, 255);"> <span style="font-family: '바탕','Batang';">--&gt; url에서 파일을 다운로드 하여 good.jpg로 저장한다.</span></span></span> <br>--15:08:51--&nbsp; http://www.hikr.org/files/33971.jpg <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; good.jpg'
Resolving www.hikr.org… done.
Connecting to www.hikr.org[88.198.38.81]:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 121,292 [image/jpeg]

100%[====================================>] 121,292       44.08K/s    ETA 00:00

15:08:55 (44.08 KB/s) - `good.jpg' saved [121292/121292]


더 자세한 정보는 http://www.cbi.pku.edu.cn/Doc/CS/wget/man.wget.html