Wget & Curl in Termux – Installation and Usage Commands

Wget and Curl are simple tools used to connect to the internet from the terminal. Both tools help you download files, open websites, test APIs, and check website information easily. They are very useful for beginners who want to learn how to use the internet with commands in the terminal.

Installation Commands

Update Termux and install wget and curl:

pkg update && pkg upgrade && pkg install wget curl -y

Check wget version:

wget --version

Check curl version:

curl --version

Usage Commands

Download a file using wget:

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

Download and save with custom name:

wget -O myfile.zip https://example.com/file.zip

Resume a download:

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

Download in background:

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

Limit download speed:

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

Download multiple files:

wget -i urls.txt

Download a webpage using curl:

curl https://example.com

Save output to a file:

curl -o page.html https://example.com

Download a file using curl:

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

Follow redirects:

curl -L https://example.com

Check website headers:

curl -I https://example.com

Send a GET request:

curl -X GET https://api.example.com

Send a POST request:

curl -X POST https://api.example.com

Send data with POST request:

curl -X POST -d "name=achik&age=20" https://api.example.com

Download with progress bar:

curl -# -O https://example.com/file.zip

Set custom user agent:

curl -A "Mozilla/5.0" https://example.com
READ ALSO  A Guide to Fun with Termux Games

Leave a Comment