Scroll to top

How to Download Files Using Command Line on Linux’s Terminal


Real Novice - 2 April, 2019 - 0 comments

Sharing is caring!

Sometimes when we use Linux we want to download files quickly and simply. Especially for a Linux Administrator who in fact is often faced with conditions where the view seen is in the form of a Command Line Interface, of course you will be confused when you want to download a file because it is not like the GUI that you can download files easily.

Downloading using the GUI interface or CLI interface each has its own advantages. The advantage of downloading using the GUI interface is that we can easily see information about the file to be downloaded, but the drawback is that sometimes we need more internet quota because sometimes we are faced with various types of advertisements that often interfere. While downloading using CLI interface has the advantage that the download process is relatively faster and without having to interfere with the advertisements that appear (I also sometimes prefer to download with CLI because it saves faster and more computer resources), although it also has disadvantages to download it must know the url address of the file that we are downloading and of course it will be difficult for those who are still beginners in the CLI command.

Downloading a file

Downloading a file

Okay, let us know some tools to download via the CLI terminal.

1. wget
wget is one of the most popular tools on the CLI to download. For Linux users, especially those who are familiar with CLI, of course, are already familiar with this one tool. wget can be used to download with HTTPS, HTTP, and also FTP protocols. In addition, this application can run both foreground and backgorund. This tool has various functions and uses that can be combined according to your needs, and to see the full function please type the “wget ​​-h” command

to download, use the command “wget ​​<space> url from the file to be downloaded” example “wget ​​https://www.novicearea.com/wget.zip”

to download multiple files in one command, first create a text file for example “nano download.txt” and inside it there are multiple url download links that will be downloaded (separate with enter).
for example there are 3 files that will be downloaded then fill in the link like this:
https://www.novicearea.com/wget1.zip
https://www.novicearea.com/wget2.zip
https://www.novicearea.com/wget3.zip
and save the file, then type the command “wget ​​-i download.txt” to start the download process.

If you want to download in background mode then add the “-b” option in your wget command, such as “wget -b https://www.novicearea.com/wget”. And if you want to download files using FTP protocol, use the command “wget ftp://user:password@host:/path-to-file/wget.zip”, if you want to download all the files recursively then use the command “wget -br ftp://user:password@ftp-host:/path-for-download/ “and wget will start downloading all files in that directory.

2. Aria2

The second is Aria. Aria is a multi-protocol download tool. Aria supports HTTP / HTTPS, FTP / SFTP BitTorrent and Metalink. Some features that make it different than others are supporting file downloads from various locations at the same time, magnetic links and a full-featured BitTorrent client. As a BitTorrent client, it supports DHT, PEX, encryption, URI Magnets, web seeding, selective downloads, and local peer discovery.
The command used to download is as follows “aria2c https://www.novicearea.com/aria.zip”, if to download the url that has been listed then it is the same as wget, add the -i option “aria2c -i download.txt “
If you want to download a file in the form of a torrent then just enter the url of the torrent that you have, just like downloading an ordinary file. If the file that you want to download is protected with a password then there is no need to worry, just enter the command “aria2c –http-user=**** –http-password=***** https://www.novicearea.com/ file.zip “. The advantage is that this tool makes it possible to resume files that have not been downloaded completely before. To do a resume, just type the command “aria2c -c https://www.novicearea.com/aria.zip”.

This Aria for some Linux distributions has not been installed by default, so you should first install it according to your respective Linux distro (ex: “yum install aria2 -y” (for CentOS user)).

3. Curl

Curl is a tool that can be used to transfer data to or from a server. It supports many protocols such as DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP and so on.Maybe for PHP programmers they are already quite familiar with this CURL tool, because PHP also uses CURL adoption in some of its functions.

Basically the commands used to download are not much different from the tools previously discussed. To download using this Curl is as follows “curl -O https://www.novicearea.com/curl.zip” and the file will be downloaded according to the name, if you want to name the file you downloaded with another name as you wish then use the command “curl -o name-of-file.zip https://www.novicearea.com/curl.zip”. And to do a resume, use the “curl -C -O https://www.novicearea.com/curl.zip” command. If you are familiar with Linux for Servers, CURL is usually installed, but if you haven’t already installed it according to the distro you are using.

4. Axel

The last one is Axel. Well, Axel is very powerful. If in Windows there are various download accelerators with various functions such as the most famous is IDM, in the Linux CLI there is Axel. Axel is able to increase download speed by doing multiple connections to download 1 file. With the multiprl feature of this connection the download speed can increase between 40% to 60% even though the supported protocol coverage is relatively less than the Curl, namely HTTP, HTTPS, FTP, and FTPS.
The command to use it is also easy, just type “axel https://www.novicearea.com/axel.zip”. if you want to do speed limitation to download so that it doesn’t interfere with the other processes, use the following command “axel –max-speed=1024000 https://www.novicearea.com/axel.zip” or “axel -s 1024000 https://www.novicearea.com/axel.zip “, the limitation format uses bytes. To download with a different name from the file on the server, use the “axel -o downaxel.zip https://www.novicearea.com/axel.zip” command.

Well that’s some of the download managers that you can use to download files using the CLI interface. You can explore with these tools to determine which tool suits your needs. Thank you for visiting this blog, see you again in the next article.

Related posts

== ==
shares