Skip to content


Dump header to file

curl -sL --dump-header cookie.txt

Store and save cookies

curl -b cookie.txt -c cookie.txt

Method 2: Store and save cookies

curl --cookie cookie.txt --cookie-jar cookie.txt will both store and send saved cookies

Method 3: Use STDOUT/STDIN for login

write to STDOUT and save into $cookie variable read cookie from $cookie variable

cookie=$(curl -c -
curl --cookie <(echo "$cookie")

### Add a Cookie
curl -b 'session=<token>'

Add Two Cookies

curl -b 'session=<token>' -b 'loggedin=true'
curl -b 'session='

Save Cookies to a File

curl -c cookies.txt

Load Cookies from a File

curl -b cookies.txt

Use curl behind socks5 proxy

curl  --socks5-hostname localhost:8001

Tor, for Windows

curl  --socks5-hostname localhost:9150

Progress bar

curl  --silent

Save to a file

curl  -o filename

Show headers

curl  ${url} -I -o headers -s
curl  -s\
|grep git_url\
|awk '{print $2}'\
|sed 's/"\(.*\)",/\1/'
curl  -s | grep -o "[[:digit:].]\+"

Check weather


See where a shortened url takes you before click

curl  -sI url | sed -n 's/Location: *//p'

Send email with curl and gmail

curl  -n --ssl-reqd --mail-from "<>"   --mail-rcpt "<user@server.tld>" --url smtps:// -T file.txt

Read Email

curl -u username:password imap:// 

List all mailboxes and NOT view any specific message

curl -u "username:password" imap:// -X 'UID FETCH 1234' 

Send an http HEAD request w/curl

curl  -I http://localhost

Extract tarball from internet without local saving

curl | tar xz

List all repos from wuseman

curl  --silent

List info from a repo

curl  --silent ""

List info about a user

curl  -Ls

List a users gists

curl  -Ls

Pentration testing

curl  -s -D -o /dev/null | grep -i Server\|X-Powered-By

Sqlmap hacking

curl  -k -i --raw -X POST -d "action=saveadwords&delconf=1&oId[]=1" 

This is better than -I for header

curl  -s -D - -o /dev/null

Heaer output

curl  -L -v -s -o /dev/null


Extract url

curl  --head --silent --write-out "%{redirect_url}\n"  --output /dev/null  

Save file download to another nanme

curl  -o magazine.pdf -C -

Get the HTTP status code of a URL

curl -Lw '%{http_code}' -s -o /dev/null -I SOME_URL

Check response time to a website

curl -s -w 'Http code: %{http_code}\nTotal time:%{time_total}s\n' -o /dev/null 

Just basic documentio

curl -w "%{time_total}\n" -o /dev/null -s 

Read your incoming EMAIL

curl -u username:password --silent "" | tr -d '
' | awk -F '' '{for (i=2; i<=NF; i++) {print $i}}' | sed -n "s/'


Upload stdout to clbin

echo hi| curl -F 'clbin=<-'

It also supports image uploads (PNG, JPG, and GIF):

curl -F 'clbin=@image.png'

If you want to use instead, type:

cat textfile.txt | curl -F 'sprunge=<-'

Upload on

curl -F 'f:1=@file.txt'
cat file.txt | curl -F 'f:1=<-'


Visit google five times in one command, various methods below:

seq 1 5 | xargs -n1 -P 5 curl -I ""
xargs -I % -P 5 curl "" \ < <(printf '%s\n' {1..5})
echo "" | xargs -P 5 -n 1 curl -I
xargs -P 5 -n 1 curl -O < list.txt

Good References

Last update: June 30, 2022
Created: June 18, 2022