리눅스 curl

  다른 뜻에 대해서는 문서를 참조하십시오.

1 개요[ | ]

cURL, curl, libcurl
/usr/bin/curl
컬 [kəːrl]</nowiki>, 씨 URL[1]
  • 다양한 프로토콜로 데이터를 전송하는 라이브러리, 명령줄 도구, 그 프로젝트
  • 원격서버(FTP, HTTP 등)에서 파일 받아 보여주는 도구[2]

2 실행예시 1: 기본[ | ]

root@zetawiki:~# curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.co.kr/?gfe_rd=cr&amp;ei=VqoMV46DJNLU8Ae7xouoBw">here</A>.
</BODY></HTML>

3 실행예시 2: 헤더정보 보기 -I[ | ]

root@zetawiki:~# curl -I google.com
HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Location: http://www.google.co.kr/?gfe_rd=cr&ei=NKoMV5TZCILD8AfCsqToCw
Content-Length: 261
Date: Tue, 12 Apr 2016 07:56:36 GMT

4 실행예시 3: 헤더+본문 보기 -i[ | ]

root@zetawiki:~# curl -i google.com
HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Location: http://www.google.co.kr/?gfe_rd=cr&ei=gqoMV9mPLczU8AefxoxA
Content-Length: 259
Date: Tue, 12 Apr 2016 07:57:54 GMT

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.co.kr/?gfe_rd=cr&amp;ei=gqoMV9mPLczU8AefxoxA">here</A>.
</BODY></HTML>

5 주요 옵션[ | ]

옵션 설명
-H, --header 헤더를 보냄
-i, --include Include protocol headers in the output (H/F)
-I, --head Show document info only
-k, --insecure Allow connections to SSL sites without certs (H)
-s, --silent 진행 상태, 에러 메시지등을 보여주지 않음
-S, --show-error -s와 함께 사용되며 실패 시 에러메시지 출력
-L, --location 요청페이지가 다른 위치로 옮겨 졌을 경우 새로운 페이지로 다시 재요청
-X, --request HTTP 메소드를 설정 할 수 있음

6 같이 보기[ | ]

7 참고[ | ]

  1. https://curl.haxx.se/docs/faq.html 'see URL', We pronounce curl with an initial k sound. It rhymes with words like girl and earl. This is a short WAV file to help you: https://media.merriam-webster.com/soundc11/c/curl0001.wav
  2. A utility for getting files from remote servers (FTP, HTTP, and others)
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}