CloudsArk
Commands Linux

wget Command Examples in Linux

Practice useful wget command examples for everyday Linux administration and troubleshooting.

wget Command Examples in Linux

Introduction

These examples show practical ways to use wget on a Linux terminal. Each example is written so you can adapt it for administration or troubleshooting.

Example 1: Basic Usage

wget https://example.com/file.tar.gz

This is the simplest form of the command and is a good starting point before adding options.

Example 2: Common Admin Task

wget -O app.tar.gz https://example.com/releases/app.tar.gz

This example reflects a common task on RHEL, Rocky Linux, AlmaLinux, or similar systems.

Example 3: Useful Option

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

This option helps narrow the result, change behavior, or handle a more realistic target.

Example 4: Real-World Scenario

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

Use this pattern when the task moves beyond a single basic command.

Example 5: Verification

ls -lh file.tar.gz

Example output:

-rw-r--r-- 1 admin admin 24M May 30 10:00 file.tar.gz

Common Mistakes

  • Recursive downloads pulling much more content than expected.
  • Forgetting to quote URLs that contain ? or &.
  • Overwriting a local file because the output name was not checked first.

Quick Reference

wget https://example.com/file.tar.gz
wget -O app.tar.gz https://example.com/releases/app.tar.gz
wget -c https://example.com/big.iso
wget -r -np https://example.com/docs/
ls -lh file.tar.gz

Summary

Good wget usage means choosing the right option, keeping the target clear, and verifying the result with output you can explain.