Downloading slides from files.ncbs.res.in server using lftp

10 views
Skip to first unread message

Dilawar Singh

unread,
Sep 6, 2015, 1:59:34 AM9/6/15
to Programming and Computing Group, NCBS Bangalore
To download files from a ftp server such as `files.ncbs.res.in`, one can use various applications. Any web-browser will do the trick. In firefox, one can simply type `ftp://stu...@files.ncbs.res.in` to access the ftp server and download files one needs.

Another option is terminal clients e.g. ftp, lftp, wget, curl etc. This post shows how to use `lftp` to download slides from `files.ncbs.res.in`.

Install `lftp` and open terminal. Then follow the following instructions:
 
 $ lftp -u student,student files.ncbs.res.in

This command opens `files.ncbs.res.in` with user `student` and password `student`. You should immediately see something like the following:

    $ lftp student@files.ncbs.res.in:~>

To get the list of files, use `ls` command.

     $ lftp student@files.ncbs.res.in:~> ls
     
-rw-r--r-- 1 502 ftpgroup 19300864 Aug 26 10:23 B&B 2015 L1 Nucleic Acids.ppt
     
-rw-r--r-- 1 502 ftpgroup 14183424 Aug 28 10:08 B&B 2015 L2 Protein.ppt
     
-rw-r--r-- 1 502 ftpgroup 3276730 Sep 2 17:35 B&B 2015 L3 Protein.pptx


This server got three files (each line has the filename at its end). To get any of them, use the `get` command.
 
    $ lftp student@files.ncbs.res.in:/> get B\&B\ 2015\ L1\ Nucleic\ Acids.ppt

Mind you, you have to "escape" the spaces in filename with \ character. Spaces and special characters such as `&` in files names are bad news. For example, in our command all spaces and special character & are prefixed by \.

Or much simpler, use patterns. For example if I want lecture 1. I do the following.
     $ lftp student@files.ncbs.res.in:/> get *L1*

It will download all files which have "L1" in their names. If you want all files:
     $ lftp student@files.ncbs.res.in:/> mirror .

This command can also be used to download whole websites (with `mirror -R .` where -R tells lftp to download recursively).
Reply all
Reply to author
Forward
0 new messages