Often we choose the Ubuntu command line in the terminal rather than its visual form because it is easier and faster to use. Also, the command line uses fewer machine resources than the graphical application, and you can easily automate tasks using a one-line command.
One of the usual daily tasks is downloading files. Using the command line, you can easily carry out this task quickly.
In this tutorial, we are going to cover the most popular commands that are used to download files from the command line or Terminal.
Downloading files using command-line
We shall discuss the following five download commands used in the Linux Terminal:
- rTorrent
- wget
- curl
- w3m
- elinks
rTorrent command
Step 1. To install the rTorrent package, use the following command:
sudo apt install rtorrent
Step 2. Now you check if the rtorrent has downloaded successfully.
rtorrent
After executing the previous command, a screen like the below should appear.
Now you can start downloading any torrent by paste the link to the torrent then press CTRL+S. To quit the rtorrent application, use the CTRL+q.
wget command
Step 1. To install the wget package, use the next command.
sudo apt install wget
Step 2. Check the wget version to ensure that it is installed successfully.
wget --version
Step 3. Now you can start installing any file you want to use the wget command beside the link, and it will begin downloading immediately.
wget download_file_url
In case you need to download multiple files using the wget command, then you need to create a new text file and write down all the files URLs that you need to download. Next, use the file name alongside with the wget command as follows:
wget -i downloadlist.txt
curl command
Step 1. To install the curl command, you use the following command.
sudo apt install curl
Step 2. To download a file using the curl command, you will need to write the file URL beside the curl command as follows:
curl -O download_file_url
In case you need to download multiple files using the curl command use command like the below one:
curl -O download_file_url_1 -O download_file_url_2
w3m command
Step 1. To install the w3m command, you can use the following command.
sudo apt install w3m
Step 2. To start browsing a URL, you can use the below command.
w3m website_url
A screen like the below should appear to you; next, you can start browsing the website and download it from it.
elinks command
Step 1. To download the elinks package, you can use the following command.
sudo apt install elinks
Step 2. To start browsing a website using the next command.
elinks website_url
A welcome screen should appear like the below one.
You can press OK to continue, and you can navigate to the file you need to download now.
Congratulations, you now can choose any of the methods to download your files.