Recently, I have covered how to install wget in Linux with a few simple steps. So, many viewers requested how do we implement these in the practical world.
Today, we cover 10 wget most used command in Linux. But if you directly jump to these posts or don’t know what we are talking about right now.
Before jumping ahead for those who are directly reading these post. First, check whether wget is installed correctly in your system or not by typing the following command in your Linux terminal.
$ wget -V
If it outputs the version information, then you good to goo or get a message something like command is not found; make sure to read our recent post on installing wget in all major Linux distribution and then continuing from here.
$ wget [OPTION] [URL]
To download webpages of any site over the internet. Simply, write it URL with wget, and it will download and save in the current location.
$ wget https://www.gnu.org/software/wget/
$ ls
index.html
To download files with a different location, simply pass the option -o with wget and specify the location you want to have your file after download.
$ wget https://ftp.gnu.org/gnu/wget/wget-1.5.3.tar.gz -O /home/trendoceans/Documents/wget.tar.gz
Downloading files without any authentication is easier using wget. But to download files using authentication is no more than a piece of cake.
$ wget --user=username --password=password https://example.com
In the above example, I have not mentioned any specific website because of privacy issues. But you can have access to your FTP server using this method.
A single file is okay to download without any restriction. But it can be a headache to leave a bunch of giant files to download in the background. It can reduce your bandwidth, and yes, you face low speed while browsing over the internet.
$ wget --limit-rate=100k --tries=100 https://ftp.gnu.org/gnu/wget/wget-1.5.3.tar.gz
If you want to read about more 6 commands you can refer to 10 Wget Command example.