In this article, we will discuss about “How to Download Files from Remote Linux Servers?” Linux is an open-source Unix-like operating system based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution.
For example, if you get stuck on the Linux terminal on a server, how do you download a file from the terminal? There is no download command on Linux, but there are some Linux commands for downloading files. In this terminal trick, you’ll learn to download files from the command line on Linux. I’m using Ubuntu here, but apart from the installation, the rest of the commands are equally valid for all other Linux distributions.
Prerequisites
Linux Server
wget is perhaps the most commonly used command line download manager for Linux and UNIX-like systems. You can use wget to download a single file, multiple files, the entire directory, or even an entire website. wget is not interactive and can easily work in the background. This means you can easily use it in scripts or even create tools like download managers. Let’s see how to use wget to download files from the terminal.
Install wget
Most Linux distributions come with wget pre-installed. It is also available in the repository of most distributions and can be easily installed using your distribution’s package manager.
For Ubuntu and Debian-based distributions you can use the apt package manager command:
sudo apt install wget
Download a file or webpage with wget
All you have to do is provide the URL of the file or web page. The file with the original name will be downloaded to the directory where you are.
wget url
Download the file in a Linux terminal using Wget
To download multiple files, you need to store their URLs in a text file and provide that text file as input to wget like this:
wget -i download_files.txt