Skip to content

Linux curl Guide

Mattscreative edited this page Dec 5, 2025 · 2 revisions

Linux curl Guide

Complete beginner-friendly guide to curl on Linux, covering Arch Linux, CachyOS, and other distributions including HTTP requests, file downloads, API interactions, and web data transfer.


Table of Contents

  1. curl Installation
  2. curl Basics
  3. HTTP Requests
  4. File Downloads
  5. Troubleshooting

curl Installation

Install curl

Arch/CachyOS:

# Install curl
sudo pacman -S curl

Debian/Ubuntu:

sudo apt install curl

Fedora:

sudo dnf install curl

curl Basics

Download File

Basic usage:

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

# -O = output (saves with original filename)

Save with Name

Custom filename:

# Save with custom name
curl -o output.txt https://example.com/file.txt

# -o = output (custom filename)

HTTP Requests

GET Request

Basic GET:

# GET request
curl https://example.com

# Shows page content

POST Request

Send data:

# POST request
curl -X POST -d "data=value" https://example.com/api

# -X = method (HTTP method)
# -d = data (POST data)

File Downloads

Follow Redirects

Handle redirects:

# Follow redirects
curl -L https://example.com/file

# -L = location (follows redirects)

Resume Download

Continue download:

# Resume interrupted download
curl -C - -O https://example.com/large-file.zip

# -C = continue (resumes from breakpoint)

Troubleshooting

curl Not Found

Check installation:

# Check curl
which curl

# Install if missing
sudo pacman -S curl

Summary

This guide covered curl usage, HTTP requests, and file downloads for Arch Linux, CachyOS, and other distributions.


Next Steps


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally