Download files with SSH

Posted December 11, 2008 // Tagged as Tutorial // 8 Comments ↓

Occasionally, my ISP (BT) does lack in connection speed. It’s not necessarily their fault, but one of the links or bridges connecting is slow. I was downloading some large mixes that a friend had done on his server, but I was only getting 40KB/s on a 200mb file, slow. I thought about it, and was wondering how I can use my dreamhost server to my advantage. I asked a couple of friends, and a mate, William told me about the SSH function, wget.

WGET tells the server to download a file of another server. As my dreamhost server sits in a huge data center with huge pipes hooked up to it I can hit speeds that I can only dream of. I know that I can hit high speeds when downloading files from my server, roughly 700KB/s – which is nearly topping out my home internet connection. Once I told the server what to download, i was hitting file transfer rates on 10MB/s on some (server to server).

So how do we go about downloading files then?

First we need to SSH into our server;

user@example.com  - then we enter our password once prompted.

once we are logged in – simply type

“wget [insertthefilelocation]”

After our files have been downloading, simply log into your server via ftp and downloading your files.

8 Responses

  1. William Hook

    December 11th, 2008 at 8:14 pm

    wget is great, if you know how to use it. You can do other neat stuff like mirror an entire website if you want – as long as everything else is linked from the homepage in at least one way, it’ll work.

    However, it can be dangerous if you don’t know what you’re doing, as if, say, you’re linking to another page which links back to the homepage, unless you tell it not to, it can infinitely loop and eventually you’ll run out of disk space (I’m speaking from experience here). =p

  2. James Bayliss

    December 11th, 2008 at 8:52 pm

    oh, awesome! I probably won’t run out of disk space though with my apparently “unlimited” disk space that I don’t have. :]

  3. William Hook

    December 11th, 2008 at 8:56 pm

    I’m sure the server itself will eventually run out of space though.

    Put this on your site and have a look at the disk space: http://phpsysinfo.sourceforge.net/

  4. ondra

    December 11th, 2008 at 9:40 pm

    wooooooow, news…

    thanks for telling the web 2.0 kids…will you teach them unzip too ? mv, cp, df, du, find, sed, awk, grep, do ? :]

    oh and
    @3 – that’s what df is for…too simple ?

  5. James Bayliss

    December 11th, 2008 at 9:43 pm

    It sure is..

  6. William Hook

    December 11th, 2008 at 9:47 pm

    df is boring though. phpsysinfo shows other stuff too. =p

  7. zzap

    December 12th, 2008 at 3:08 am

    WOAH, WGET?! THAT’S SUCH AN AWESOME FEATURE. YOU CAN DOWNLOAD STUFF FROM THE COMMAND LINE. I DON’T BELIEVE IT. THIS HAS TO BE THE BEST THING EVER INVENTED. I AM GOING TO WRITE A BLOG POST ABOUT THIS TOO, AND TELL THE NEW YORK TIMES ABOUT THIS “WGET”! SO COOL! AMAZING! A+++

  8. William Hook

    December 12th, 2008 at 8:30 am

    lol @ zzap

Leave a Reply