Network

curl

Transfer data from or to a server using URLs with support for many protocols.

Synopsis

syntax
curl [OPTION]... URL...

Examples

GET request to an API
curl https://api.example.com/data
Download file
curl -o file.zip https://example.com/file.zip
POST JSON data
curl -X POST -H 'Content-Type: application/json' -d '{"key":"val"}' https://api.example.com
Silently follow redirects and preview
curl -sL https://example.com | head
Fetch only response headers
curl -I https://example.com

Common options

FlagDescription
-oWrite output to file
-OSave with remote filename
-LFollow redirects
-sSilent mode
-vVerbose output
-HAdd custom header
-XHTTP method
-dPOST data

About curl

The `curl` command transfer data from or to a server using URLs with support for many protocols. Networking commands handle connectivity testing, DNS resolution, data transfer, remote access, firewall rules, and traffic analysis.

Linux is the dominant server operating system, and strong networking skills are essential for web hosting, container orchestration, security auditing, and infrastructure management. The command accepts 8 commonly used flags shown above, though the full set of options is available in the man page (`man curl`).

The 5 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Network Commands

Other commands in the Network category

Related tools