Code(alpha) - Tips & Tutorials for Linux

 
  • Increase font size
  • Default font size
  • Decrease font size
Home Tips General / Linux How to download under Terminal or ssh, using wget

How to download under Terminal or ssh, using wget

Print

That's amazing everything you can do under linux, you don't even need to open your internet browser to download a file. Well, when you are connected to your dedicated or private server through ssh, you don't have any desktop.

wget will provide you functions to do almost any kind of HTTP/FTP downloads.

If you don't have wget, just type this to install it:

sudo apt-get install wget


Singe File Download into current directory

To easily download a single file, just use this:

wget "url"

Just replace url with the URL (http, https or ftp) you want, like this:

wget "http://www.gtlib.gatech.edu/pub/ubuntu-releases/hardy/ubuntu-8.04.1-desktop-i386.iso"

which will download ubuntu desktop ISO to the current directory.

 

Single File Download into specific directory

For this, we need to specify the directory, like this:

wget -P "/tmp" "http://www.gtlib.gatech.edu/pub/ubuntu-releases/hardy/ubuntu-8.04.1-desktop-i386.iso"

The file will be saved into /tmp, just replace this path that you want.

 

Multiple Files Download

wget "http://www.freeimageslive.com/galleries/transtech/computer/pics/tech00055p.jpg" "http://www.freeimageslive.com/galleries/transtech/computer/pics/objects00039p.jpg"

You can add as much URLs as you want. You can use the -P option (see above) to download those files in a specific directory.

If you have a file with the URLs, you can use the -i option.

wget -i my_urls.txt

 

Website Download

If you need to download a whole website, just put the website URL and use the recursive option:

wget -R "http://www.somewebsite.com"

wget will create a directory with the website name and put all the files in it. The default depth is 5, you can change it using the --level=depth option (0 for infinite depth).
You have to be careful using this commands, you might get banned from the website you download from if you are requesting too many files for a certain period of time.

 

 

Type this "man wget" in a terminal to see more about wget.

 



Add this page to your favorite Social Bookmarking websites
Reddit! Del.icio.us! JoomlaVote! Google! Live! Facebook! StumbleUpon! Yahoo! Free social bookmarking plugins and extensions for Joomla! websites!
Last Updated ( Monday, 25 August 2008 11:01 )  

Add your comment

Your name:
Your email:
Subject:
Comment:

Useful Links


Newsflash

The next Ubuntu release, codenamed Intrepid Ibex, version 8.10 beta just released!

If you wish to try it out and find those hidden bugs, go ahead : http://www.ubuntu.com/testing/intrepid/beta

Note: This is a beta release. Do not install it on production machines. The final stable version will be released on October 30th, 2008.