Skip to content

cURL/Wget🔗

Back

Installation🔗

apt update
apt install curl wget

cURL🔗

Basic Commands🔗

Download a file🔗

curl -O https://example.com/file.txt

Send a GET Request🔗

curl https://example.com/api

Send a POST Request🔗

curl -X POST -d "param1=value1" https://example.com/api

Follow Redirects🔗

curl -L https://example.com

Include Custom Headers🔗

curl -H "Authorization: Bearer token" https://example.com/api

Save output to a File🔗

curl -o output.txt https://example.com/file.txt

Upload a File🔗

curl -F "[email protected]" https://example.com/upload

Use a Proxy for connection🔗

curl -x http://proxy.example.com:8080 https://example.com

Use curljson alias🔗

alias curljson='curl -H "Content-Type: application/json"'
curljson https://example.com

Wget🔗

Basic Commands🔗

Download a File🔗

wget https://example.com/file.txt

Download in Background🔗

wget -b https://example.com/file.txt

Resume a Download🔗

wget -c https://example.com/file.txt 

Download Recursively🔗

wget -r https://example.com

Limit Download Speed🔗

wget --limit-rate=100k https://example.com/file.txt

Download with Auth🔗

wget --user=username --password=password https://example.com/file.txt

Mirror a website🔗

wget -mk https://example.com