SystemMen - In this article, I will show you how to use
wget download a file and save as a filename different?
Wget is a tool that supports downloading files in Linux, which is very light and useful.
Download files with wget
wget to download files is quite simple, its syntax is as follows.
$ wget [url]
For example, let’s try downloading a file with the link as follows.
$ wget https://gitlab.com/Danny_Pham/WriteBash.com/raw/master/Install/08-Script_install_rkhunter_on_CentOS_6.sh
And as you see the result in the image above, the downloaded file is named
Download a file and save as a different filename
Okey, now we will go to the main problem of the article.
Recommended Reading: How to install rkhunter on CentOS 6
There are times when you want to save the file as another name when you download it to your computer. How to do? Using wget with the
-O option will solve this problem.
There are 2 ways to type
wget with the
The first way.
$ wget -O [filename] [URL]
The second way.
$ wget [URL] -O [filename]
In some old Linux operating systems, maybe the second way will not work.
For example, with the above link, you can type the command below.
$ wget https://gitlab.com/Danny_Pham/WriteBash.com/raw/master/Install/08-Script_install_rkhunter_on_CentOS_6.sh -O script.sh
This article is just a small tip, it’s nothing complicated. But sometimes, it is useful for those who have never used wget or just started using Linux.If you liked this article, then please subscribe to our YouTube Channel for more video tutorials. You can also find us on Twitter and Facebook.
If you appreciate what we share in this blog, you can support us by:
- Stay connected to: Facebook | Twitter | Google Plus | YouTube
- Subscribe email to recieve new posts from us: Sign up now.
- Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
- Become a Supporter - Make a contribution via PayPal.
- Support us by purchasing Ribbon Lite Child theme being using on this website.
We are thankful for your support.