You can ftp stuff in and out of a Unix/Linux account. Suppose you have an account on lark.cc.ku.edu or people.ku.edu. You can put files "up" there or get then down to the system you are on.

I want you to understand ftp as a command line program. Once you understand that, you can use any fancy graphical ftp program you want.

ftp is a program that you can run to move things with the standard "file transfer protocol". Lucky for us, the "ftp" program exists on all major computer platforms, so it works the same if you are logged into a lark account as if you were in a Microsoft windows computer in the "Dos Command box" (You've seen that, haven't you?).

So get into the windows command box or a Unix login shell. Obviously, if you are in windows, you will be copying files into your windows system. If you are in Unix, you will be copying files into your Unix account.

To bring stuff in, follow these steps:

1) cd to the directory where you want stuff to end up

2) ftp name.of.ftp.site

If you have an account on "name.of.ftp.site", you can log in under that name and password. If you don't have an account, you hope that they allow anonymous access, meaning you can tell them your user name is "anonymous" and they will ask you for a password, usually your email address. Below I have an example.

3) Once the ftp program has connected you, use "ls" and "cd" to get to the directory you want on the remote site.

4) The command "get" will get a file. "mget" will get a bunch of files. "put" will put a file from where you are to the ftp site. "mput" will put a bunch of files.

The transfer mode can be either "ascii" mode (that's text) or "binary" mode, that's pictures, MSWord docs, programs, and other things. If you want to transfer text, set that mode by typing

# ascii
and if you want binary, set that mode by typing
# binary

Set the mode before you do put or get statements.

A Concrete example.

Why not see what they have in /pub/libraries/icpsr on raven? (that means, at the prompt, run the ftp command to log into the raven system with

ftp raven.cc.ukans.edu

and the username you give is "anonymous" and then the password is your email address. Then look at the directory list with "ls" and change to the place where the library dumps its stuff with

cd /pub/libraries/icpsr

Choose a directory in there. The directories are numbers that represent ICPSR study numbers, such as 6645. Change into a directory.

4) Use the wildcard * to retrieve all files that begin with a letter, say T, as in

mget T*

If you want all the files, just type

mget *

It should ask for permission to transfer each. There is a way to get rid of the requests for permission. If you put the -i command after ftp when you log in, it will just grab all the files, without asking you if you want each one (i.e., ftp -i raven.cc.ukans.edu).

5) You may have screwed yourself by making the transfer too soon. If the stuff you want is text, it will probably be OK. If it is files in "binary" format, you need to make sure the ftp respects that. To set the format to binary, type "binary" or "bin" at the prompt. Then do the mget again.

6) If you only need to get one file, you can do this

get filename

but you have to type the entire file name, which is tedious, compared to mget f*.

7) After you have finished transferring files, you type

quit

to exit the ftp program.

You should find yourself back in the "target directory" with a bunch of files you just transferred. If they happen to be tarred and gzipped, then opening them up requires you to use the standard tools for these formats. Read more in TarAndGzip.

Sometimes you need to transfer stuff from your lark account. To do that, log into your lark account. Then inside that shell, use ftp to open up a remote place. For example, to go to my account on raven from my account on lark, I do

ftp raven.cc.ku.edu

Then, instead of mget, you use mput. Try it out!

-- PaulJohnson - 08 Dec 2002

 
|Powered by TWiki