모든 곳의 HTTP/{,S}, FTP, ... 클라이언트
curl 이 HTTP 요청 하나 보내고 응답 출력. 모든 API 문서가 예시로 보여주는 도구. curl https://example.com 이 HTML 출력.
일상 flag
-L— redirect 따라가기.-sS— silent + error 만 표시. pipe 친화 default.-o file— 파일로 저장.-O는 URL 의 파일명 사용.-X POST/-X PUT— 메서드 변경.-H 'Header: Value'— 헤더. 반복 가능.-d 'data'— POST 바디 (form-encoded).--data-urlencode 'key=value with spaces'— URL 인코딩.--data @body.json— 파일에서 읽기.-u user:pass— basic auth.-i/-I— 헤더 포함 / 헤더만.-w '%{http_code}\n'— 커스텀 출력 (status, time 등).
JSON POST
curl -sS https://api.example.com/items \
-H 'Authorization: Bearer ${TOKEN}' \
-H 'Content-Type: application/json' \
-d '{"name":"pippa","qty":3}'GET + auth + jq
curl -sS -H 'Authorization: token ghp_xxx' \
https://api.github.com/user/repos | jq '.[].name'큰 파일 진행도 보면서 다운로드
curl -L -o ubuntu.iso --progress-bar https://...헬스 체크 one-liner
curl -sS -o /dev/null -w '%{http_code} %{time_total}s\n' https://api아무 튜토리얼의 curl 붙이지 마
curl ... | bash 같은 pipe-to-shell 인스톨러는 서버가 보내는 거 다 실행. 서버 손상 시 그쪽 코드 그대로 실행. 파일로 저장 → 읽기 → 실행.