How to Download Files on Linux Without a Web Browser (And Why You Should Do It)


When you want to download files from the Internet, you usually open your web browser, navigate to the file in question and let the download begin. But did you know there is a better way? This is the order wget.

The command wget uses multiple simultaneous connections, resulting in much faster downloads. Moreover, wget is able to resume downloads interrupted by network problems. Additionally, unlike web browsers, wget isn’t cluttered with cookies, add-ons, and other features that can slow it down or make it less reliable – which is especially useful when you need to download a large file. So why relegate this task to your browser? Well there’s no good reason.

If you use Linux, opt for wget. Let me show you how to do it.

How to install wget

To use wget, you will need a running Linux instance and a user with sudo privileges (for installation).

1. Open a terminal window and install wget

Wget should be installed by default on your distribution. But if you don’t, here’s how to get it. Log in to Linux and open a terminal window. From here, here are the commands to install wget on Ubuntu, Arch and Fedora distributions.

  • For Ubuntu-based distributions - sudo apt-get install wget -y
  • For Arch-based distributions - sudo pacman -S wget
  • For Fedora based distributions – sudo dnf install wget -y

2. Using wget

Wget is only used from the command line, so keep your terminal window open.

Let’s say you want to download an ISO for Ubuntu Desktop Linux and you found the link (from the official download site) which is https://releases.ubuntu.com/22.04.3/ubuntu-22.04.3-desktop-amd64 .iso.

Instead of downloading it from your browser, you can simply run the following command:


wget https://releases.ubuntu.com/22.04.3/ubuntu-22.04.3-desktop-amd64.iso

One thing to keep in mind is that the file will download to the directory you are currently working in.

3. Save a file in another directory

Let’s say you have the /ISOS directory and you want to download the Ubuntu ISO to that directory. To do this, you use the -P option (for Path), as follows:


wget -P /ISO/ https://releases.ubuntu.com/22.04.3/ubuntu-22.04.3-desktop-amd64.iso

How to download multiple files at once with wget

Here’s another cool tip. With wget you can download multiple files at once. Here’s how to do it.

1. Create a file that will contain the addresses

First, you need to create a new file that will contain the URLs of the files to download. Let’s say you want to download the ISO files for Ubuntu, Fedora and Arch Linux. Create the file using the command:


nano downloads

In this file, add the three URLs for downloads:


https://releases.ubuntu.com/22.04.3/ubuntu-22.04.3-desktop-amd64.iso https://download.fedoraproject.org/pub/fedora/linux/releases/39/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-39-1.5.iso http://mirrors.acm.wpi.edu/archlinux/iso/2023.12.01/archlinux-2023.12.01-x86_64.iso

Save and close the file.

2. Start download

To start the download, run the command:


wget -i downloads

You can then walk away from the computer and let the downloads complete.

3. Continue an interrupted download

Let’s imagine that a download is interrupted. Instead of downloading the entire file again, simply run the command with the -c option, as follows:


wget -c https://releases.ubuntu.com/22.04.3/ubuntu-22.04.3-desktop-amd64.iso

If you download via file (like we did above) and the download is interrupted, you can continue it in the following ways:


wget -c -i downloads

And that’s all there is to it to use wget to download files more reliably (and faster) to your Linux machine.


Source: “ZDNet.com”



Source link -97