this quick and simple article, we will install wget command on a CentOS 6.7 server and we have included a wget cheat sheet. Wget is a free software package for downloading files using HTTP, HTTPS and FTP.
Prerequisites
A CentOS 6.7 server with Root privileges, if you do no have a server and would like a SSD Cloud server, you can get one here.
Installing wget on a CentOS 6.7
Install wget using the following command:
yum install wget
You will be asked if it is okay to install the downloaded size, you would just type for yes and press Enter to continue. I have screenshot a successful install below
Quick wget Cheat Sheet
To download a single file from a website using the following command:
wget http://sitename.com/file.jpg
If your web page requires a username and password use the following command:
wget –user=youruser –password=yourpassword http://sitename.com/file.jpeg
Download a file from an ftp site using the following command:
wget ftp://sitename.com/file.jpeg
If your ftp site requires a username and password use the following command:
wget —ftp-user=youruser –ftp-password=yourpassword ftp://sitename.com/file.jpeg
Download and entire website using the following command:
wget -r http://sitename.com
Download and save it in a specific path using the following command:
wget –directory-prefix=folder/nextfolder sitename.com
Download a file and save it under a different name using the following command:
wget –output-document=filename.php sitename.com
Resume an interrupted file download using the following command:
wget –continue sitename.com/filename.mp4
Limit download speed of a file using the following command:
wget –limit-rate=1000k http://sitename.com/file.iso
Now you have successfully installed wget and have some examples to work with! You can see the wget manual by running “wget -h”. Please check back here for more updates or check out our related how-to’s below.
Recent Comments