Vol. I · No. 46The command line sectionSat, 10 Oct 2026
Linux · sockets & transfer

curl

one request, fully visible

curl sends a single request and, with -v, narrates each layer on the way: the address chosen, the TCP connection, the TLS negotiation and certificate, then the request and response headers. It is a browser with nothing hidden — no cache, no cookies, no retries unless you ask.

A page that will not load has failed at one particular layer — and curl -v says which.

Speaks
HTTP & HTTPS
plus FTP, SMTP and more
See everything
-v
handshake and headers
Headers only
-I
a HEAD request
Follows redirects
Only with -L
off by default

At the terminal

Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.

user@netflow — bashcurl
$ curl -v https://example.com/
1* Trying 192.0.2.10:443...
2* Connected to example.com (192.0.2.10) port 443
* ALPN: curl offers h2,http/1.1
3* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* subject: CN=example.com
4* SSL certificate verify ok.
* using HTTP/2
5> GET / HTTP/2
> Host: example.com
> User-Agent: curl/8.5.0
> Accept: */*
>
6< HTTP/2 200
< content-type: text/html; charset=UTF-8
< content-length: 1256
Illustrative session · names, sizes and dates are examples, and every address is from a documentation or private range
Reading the output

What the numbered lines are telling you

1
DNS has already happened

The name was resolved before this line. "Trying" is the TCP connection attempt; a hang here is a routing or firewall problem.

2
Connected means the handshake completed

SYN, SYN-ACK, ACK all succeeded. From here down, any failure is above the transport layer.

3
The TLS version and cipher both sides agreed

TLS 1.3 with an AEAD cipher. An old version here is a server that needs attention.

4
The certificate chained to a trusted root

Name, validity dates and issuer all checked out. A failure stops the request before any HTTP is sent.

5
Lines starting > are what curl sent

The request line and headers, exactly as they went out. This is where to confirm a header or token is really being sent.

6
Lines starting < are the server's reply

The status first, then the response headers. The body follows after a blank line.

Switches

A switch changes how the command behaves. These are the ones used day to day; man curl lists the rest. Single-letter switches can usually be joined, so -l -a may be written -la.

-I
Fetch the response headers only, with a HEAD request.
-v
Verbose: show the connection, the TLS handshake and every header sent and received.
-L
Follow redirects to the final location.
-o FILE
Save the response to this file. -O uses the name from the URL.
-s
Silent: no progress meter. Add -S to still show errors.
-H "NAME: VALUE"
Add a request header.
-X METHOD
Use this request method: POST, PUT, DELETE.
-d DATA
Send this data as the request body — makes the request a POST.
-k
Skip certificate verification. For testing only.

Variations worth knowing

The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.

curl -sI https://example.com

Response headers only, with the progress meter silenced.

curl -L -o page.html https://example.com

Follows redirects and saves the body to a file.

curl --resolve example.com:443:192.0.2.20 https://example.com

Sends the request to a specific address while keeping the right hostname and certificate check — testing one server behind a load balancer.

curl -w "%{time_connect} %{time_starttransfer}\n" -so /dev/null https://example.com

Prints how long the connection and the first byte took, and nothing else.

In cybersecurity

curl runs wherever a shell does, which makes it both the standard test tool and the standard download tool for attackers. Its flags can also quietly switch off the protection TLS provides.

Never normalise -k

--insecure skips certificate verification, so the request can be intercepted by anyone on the path. It does not belong in a script.

Piping to a shell

"curl … | sh" runs whatever the server sends at that moment. Download, read, then run.

Credentials on the command line

A password in -u or in the URL lands in shell history and in the process list. Use a netrc file or a prompt.

Server-side request forgery

An application that fetches a user-supplied URL can be pointed at internal addresses. curl is how that is demonstrated.

Reading the headers

Missing Strict-Transport-Security or a permissive CORS header shows up in one -I request.

A common exfiltration path

An outbound POST from a server that has no reason to make one is worth an alert.

Protocols it shows

HTTPHTTP/2TLSTCPDNSFTP

Read alongside