Wget download a file and save as a different filename

Share this post to your friends !
  • 1
    Share

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

Using 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
wget-download-a-file-and-save-as-a-different-filename-01 Wget download a file and save as a different filename
Use wget to download a file.

And as you see the result in the image above, the downloaded file is named 08-Script_install_rkhunter_on_CentOS_6.sh.

Download a file and save as a different filename

Okey, now we will go to the main problem of the article.

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 -O option.

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
wget-download-a-file-and-save-as-a-different-filename-02 Wget download a file and save as a different filename
Use wget download a file and save as a different filename.

Conclusion

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.


Share this post to your friends !
  • 1
    Share
If you appreciate what we share in this blog, you can support us by:
  1. Stay connected to: Facebook | Twitter | Google Plus | YouTube
  2. Subscribe email to recieve new posts from us: Sign up now.
  3. Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
  4. Become a Supporter - Make a contribution via PayPal.
  5. Support us by purchasing Ribbon Lite Child theme being using on this website.

We are thankful for your support.

«« »»

Got something to say? Join the discussion

Please keep in mind that all comments are subject to our Comment Policy. Your email address will not be published.
This site uses Akismet to reduce spam. Learn how your comment data is processed.