🌐 Linux/Unix: Networking & Communication
Estimated reading: 3 minutes 264 views

Linux/Unix: Web Tools – wget, curl, lynx Explained with Practical Examples

Introduction – Why Learn Web Tools in Linux?

Linux provides powerful CLI tools to access, download, and interact with web resources directly from the terminal. Whether you’re fetching files, making HTTP requests, or browsing the web in a terminal, tools like wget, curl, and lynx are essential for developers, sysadmins, and automation scripts.

In this guide, you’ll learn:

  • How to download files using wget
  • How to make web requests and APIs with curl
  • How to browse the web from the terminal using lynx
  • Real-world examples and outputs for each tool

1. wget – Non-Interactive File Downloader

What is wget?

wget is a command-line utility to download files from the web using HTTP, HTTPS, or FTP protocols.

Syntax:

wget [options] URL

Common Options:

OptionDescription
-cResume partially downloaded file
-OSave with a custom filename
-rRecursive download
--limit-rateLimit download speed

Example 1: Download a file

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

Example 2: Resume a broken download

wget -c https://example.com/large.iso

Example 3: Save with a custom name

wget -O latest.html https://example.com

Output:

Saving to: β€˜latest.html’
HTTP request sent, awaiting response... 200 OK

2. curl – Transfer Data from or to a Server

What is curl?

curl is a command-line tool to send requests and receive responses from URLs. It supports HTTP, FTP, SFTP, and more.

Syntax:

curl [options] [URL]

Common Options:

OptionDescription
-oSave to file
-IFetch headers only
-dSend data in POST requests
-XSpecify HTTP method (GET, POST, etc)
-HAdd custom header

Example 1: Download a webpage

curl https://example.com

Example 2: Save output to file

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

Example 3: Send POST data to an API

curl -X POST -d "name=Vaibhav&age=25" https://httpbin.org/post

Output (JSON):

{
  "form": {
    "age": "25",
    "name": "Vaibhav"
  }
}

3. lynx – Terminal-Based Web Browser

What is lynx?

lynx is a text-based web browser that lets you navigate websites right from the terminal.

Syntax:

lynx [options] [URL]

Install it using:

sudo apt install lynx

Example 1: Open a website in the terminal

lynx https://example.com

Output: A keyboard-navigable text UI of the webpage.

Navigation Keys:

  • ↑ / ↓: Move through links
  • β†’: Follow a link
  • q: Quit
  • g: Enter a new URL

Web Tools Comparison Table

ToolMain UseSupportsGUI NeededBest For
wgetFile downloadsHTTP/FTPAutomated bulk or scheduled pulls
curlAPI calls & data transfersHTTP/FTP/SMTPWeb APIs, headers, scripting
lynxText-based web browsingHTTP/HTTPSBrowsing in terminal or SSH-only

Summary – Recap & Next Steps

These web tools make Linux a powerful platform for interacting with the internetβ€”whether you’re downloading, debugging APIs, or browsing sites in restricted environments.

Key Takeaways:

  • Use wget for robust downloading and automation.
  • Use curl for web requests, APIs, and data posting.
  • Use lynx to browse websites in a terminal-only environment.

FAQs

What’s the difference between wget and curl?
wget is best for downloading entire files or sites. curl is more flexible for sending/receiving custom HTTP requests.

Can wget handle recursive downloads?
Yes, use wget -r URL for entire websites (respect robots.txt).

How can I view only HTTP headers with curl?
Use:

curl -I https://example.com

Is lynx useful without a GUI?
Absolutely. It lets you browse web content in SSH or headless environments.

Can I download an entire site with wget?
Yes:

wget -r -np -k https://example.com

Share Now :
Share

πŸ”΅ Linux/Unix: Web Tools (wget, curl, lynx)

Or Copy Link

CONTENTS
Scroll to Top