Skip to content


What Where
Official Page
Docs or
Windows scoop install curl
Ubuntu sudo apt -y install curl

Random Examples

Example to check /24 range in "" for the last 3 days

curl -s -G --data-urlencode "network=" -d maxAgeInDays=$DAYS -H "Key:" -H "Accept: application/json" |jq '.data.reportedAddress'

If you want to inspect the headers of a response from some endpoint include the -I flag and curl will return just the headers.

curl -I localhost:3000/posts

Example of using curl with basic auth credentials

curl -u username:password

Query a website e.g. request a json response from on TXT records of the domain

curl -s -H 'accept: application/dns-json' ''

Send Mail

curl --ssl-reqd --url 'smtps://' --user '' --mail-from '' --mail-rcpt '' --upload-file mail.txt

mail.txt file contents:

From: "User Name" <>
To: "John Smith" <>
Subject: This is a test

Hi John,
I’m sending this mail with curl thru my gmail account.

Some more information:


Create Folders

curl -X MKCOL 'http://your.server/uploads/nested_folder1' --user 'name:pwd'

Copy Files

curl -T <filename> -u <username>:<password> <url> -o /dev/stdout

Copy all files in a Folder (and subfolder). Folders must already exist.

cd local_folder_to_upload && find . -exec curl -T {} 'http://your.server/uploads/{}' --user 'name:pwd' \;