Fundamentals 7 min read

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.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Master File Downloads in Linux: wget and curl Step‑by‑Step Guide

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 wget

Downloading with wget

Single file or webpage

wget URL

Downloads 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.txt

Custom output name

wget -O filename URL

Downloading a directory (FTP)

wget -r ftp://server-address.com/directory

Mirroring an entire website

Use the mirror mode with additional options to make the offline copy functional.

wget -m --convert-links --page-requisites website_address

Resuming interrupted downloads

wget -c URL

Installing curl

Curl is not always pre‑installed but is available in most distribution repositories.

sudo apt install curl

Downloading with curl

Single file

curl -O URL

Multiple files

curl -O URL1 URL2 URL3

Custom output name

curl -o filename URL

Follow redirects

When a URL redirects, add -L to follow the final location.

curl -L -O URL

Resuming downloads

curl -c URL

Conclusion

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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxFile DownloadcURLwget
Liangxu Linux
Written by

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.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.