Master File Downloads in Linux: wget and curl Step‑by‑Step Guide
This article teaches how to install and use wget and curl on Linux to download single files, multiple files, directories, or whole websites, covering custom filenames, recursive retrieval, mirroring options, and how to resume interrupted downloads.
Introduction
If you work in a Linux terminal—especially on a server—and need to download files, this guide shows two command‑line tools, wget and curl , and explains how to install and use them for various download scenarios.
Installing wget
Most Linux distributions ship wget by default; otherwise install it from the package manager.
sudo apt install wgetDownloading with wget
Single file or webpage
wget URLDownloads the resource to the current directory using its original name.
Multiple files
Save all URLs in a text file (one per line) and supply it with -i.
wget -i download_files.txtCustom output name
wget -O filename URLDownloading a directory (FTP)
wget -r ftp://server-address.com/directoryMirroring an entire website
Use the mirror mode with additional options to make the offline copy functional.
wget -m --convert-links --page-requisites website_addressResuming interrupted downloads
wget -c URLInstalling curl
Curl is not always pre‑installed but is available in most distribution repositories.
sudo apt install curlDownloading with curl
Single file
curl -O URLMultiple files
curl -O URL1 URL2 URL3Custom output name
curl -o filename URLFollow redirects
When a URL redirects, add -L to follow the final location.
curl -L -O URLResuming downloads
curl -c URLConclusion
Both wget and curl are popular Linux tools for downloading files from the terminal; wget is generally simpler for basic tasks, while curl provides finer‑grained control. Other command‑line browsers such as elinks or w3m can also be used for similar purposes.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
