bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Learn/Bash/Networking
Bash•Networking

Bash wget Command - Non-Interactive Network Downloader

Using the wget Command

The wget command is used to download files from the web.

It's a powerful tool for downloading single files, entire websites, or even batch downloads.

Basic Usage

To download a file, use wget url :

Example

wget http://example.com/file.txt

Options

The wget command has options to change how it works:

  • -b - Run in the background
  • -q - Quiet mode (no output)
  • -r - Download directories recursively
  • -c - Continue getting a partially-downloaded file
  • --limit-rate - Limit download speed

Run in the Background

The -b option allows you to run wget in the background.

This is useful for long downloads that you don't want to monitor continuously.

Example: Run in the Background

wget -b http://example.com/file.txt

Quiet Mode

The -q option allows you to run wget in quiet mode.

This is useful for scripts or automated tasks where output is not needed.

Example: Quiet Mode

wget -q http://example.com/file.txt

Recursive Downloads

The -r option allows you to download directories recursively.

This is useful for downloading entire websites or directories.

Example: Recursive Downloads

wget -r http://example.com/directory/

Continue Getting a Partially-Downloaded File

The -c option allows you to continue downloading a file that was partially downloaded. This is useful for resuming interrupted downloads.

Understanding Wget Output

The output of the wget command can vary depending on the options used. Here are some common elements:

  • Download Progress: Shows the progress of the download.
  • File Size: The size of the file being downloaded.
  • Download Speed: The speed at which the file is being downloaded.
  • Time Remaining: Estimated time remaining for the download to complete.

Batch Downloads

Wget can be used for batch downloads. For example, wget -r http://example.com/directory/ downloads all files in a directory.

Example: Batch Downloads

wget -r http://example.com/directory/

Previous

Bash curl Command - Transfer a URL

Next

Bash ssh Command - OpenSSH SSH Client

This chapter

Overview
6

Lessons

19m

Read time

1. Bash ping Command - Send Request to Network Hosts2. Bash curl Command - Transfer a URL3. Bash wget Command - Non-Interactive Network Downloader4. Bash ssh Command - OpenSSH SSH Client5. Bash scp Command - Secure Copy6. Bash rsync Command - Remote (and local) File-copying

On this page

Using the wget CommandBasic UsageOptionsRun in the BackgroundExample: Run in the BackgroundQuiet ModeExample: Quiet ModeRecursive DownloadsExample: Recursive DownloadsContinue Getting a Partially-Downloaded FileUnderstanding Wget OutputBatch DownloadsExample: Batch Downloads