Comprehensive cURL Commands for Every Developer
Discover an extensive collection of cURL commands designed to enhance your development workflow. From fetching your IP address in various formats to monitoring cryptocurrency exchange rates, and even keeping up with Covid-19 statistics, this cheatsheet is your go-to resource for efficient and powerful web operations.
Trace the redirect chain until the server runs out of lies
Follow the first hop, expose the last - clean and ruthless
#!/usr/bin/env bash
while read -r url; do
redirects=0
next="$url"
first=""
final=""
while :; do
loc=$(curl -kIs -o /dev/null -w "%{redirect_url}" "$next")
[ -z "$loc" ] && break
redirects=$((redirects+1))
next="$loc"
# Spara första redirect-hoppet
[ -z "$first" ] && first="$loc"
# Uppdatera slutdestinationen
final="$loc"
done
# Skriv ut första redirect-hoppet (om det finns)
[ -n "$first" ] && echo "$first"
# Skriv ut slutdestinationen på samma rad med (Final Destination)
echo "${final:-$url} (Final Destination)"
echo "Total redirects: $redirects"
echo
done < <(cat <<EOF
http://tinyurl.com/2p9h4p6u
http://goo.gl/fbsS
http://is.gd/short
EOF
)
Measure latency like a network ninja’s whisper
"Silent full‑spectrum autopsy of an HTTP session"
curl -s -o /dev/null http://192.168.1.1 -w "\
-- ANSLUTNING --\n\
IP (Fjärr): %{remote_ip}\n\
Port (Fjärr): %{remote_port}\n\
IP (Lokal): %{local_ip}\n\
Port (Lokal): %{local_port}\n\
\n\
-- PRESTANDA (SEKUNDER) --\n\
DNS-uppslag: %{time_namelookup}s\n\
TCP-handskak: %{time_connect}s\n\
App-handskak: %{time_appconnect}s\n\
Pre-transfer: %{time_pretransfer}s\n\
Redirect-tid: %{time_redirect}s\n\
TTFB (Start): %{time_starttransfer}s\n\
TOTAL TID: %{time_total}s\n\
\n\
-- DATA & STATUS --\n\
Statuskod: %{http_code}\n\
HTTP-version: %{http_version}\n\
Antal Redirects: %{num_redirects}\n\
Storlek (Ned): %{size_download} bytes\n\
Hastighet (Ned): %{speed_download} bytes/s\n\
Header-storlek: %{size_header}\n\
Request-storlek: %{size_request}\n\
Effektiv URL: %{url_effective}\n"
Print IP-Adrress (Inline)
curl l2.io/ip
curl https://echoip.de
curl ifconfig.me
curl ipecho.net/plain
curl -L ident.me
curl -L canihazip.com/s
curl -L tnx.nl/ip
curl wgetip.com
curl whatismyip.akamai.com
curl ip.tyk.nu
curl bot.whatismyipaddress.com
curl curlmyip.net
curl api.ipify.org
curl ipv4bot.whatismyipaddress.com
curl ipcalf.com
Print IP-Adrress (New LiNE)
curl ipaddy.net
curl eth0.me
curl ipaddr.site
curl ifconfig.co
curl ifconfig.pro
curl curlmyip.net
curl ipinfo.io/ip
curl icanhazip.com
curl checkip.amazonaws.com
curl smart-ip.net/myip
curl ip-api.com/line?fields=query
curl ifconfig.io/ip
curl -s ip.liquidweb.com
curl ifconfig.es
curl ipaddress.sh
curl 2ip.ru
Title/URL of latest upload from indicated YouTube channel
HTTP request and response Service (e.g. send response after 4 seconds)
HTTP response defined in the request parameters
HTTP proxy makes new requests based on input parameters
Shorten url (e.g. shorten "https://youtube.com")
Find out the time spent between request and response
Find out the http status code of a URL



