INTERNET QUICK GUIDE: FTP COMMANDS (on CUNIX)

Anonymous FTP (File Transfer Protocol) allows anyone on the Internet to connect to an anonymous (public) FTP archive on another computer on the Internet and to look at and/or transfer files to one's own computer. These archived files could be computer software, computer graphics, or text files such as papers, journals, discussion groups, course syllabi, or bibliographies.
On CUNIX, an FTP session is initiated under UNIX by typing ftp (or ftp site address) at the UNIX ($) prompt. When an FTP session is initiated, the prompt changes to ftp> . Once connected to the site, you will be asked for NAME (your account). Type anonymous . Then, when asked for password, type your email address (in most cases).

SHORT COMMAND SUMMARY (Plane text version. Click here for table version)

===============================================================================
Purpose                                              | Command
=====================================================|=========================
Get full list of FTP host commands within FTP session| help
-----------------------------------------------------|-------------------------
Initiate FTP session                                 |ftp  OR  ftp site address
-----------------------------------------------------|-------------------------
Connect to a site if you opened a session without    | open site address
specifying the site name                             |
-----------------------------------------------------|-------------------------
Display name of directory you are currently in       | pwd
-----------------------------------------------------|-------------------------
Display names of files in directory                  | ls -al
-----------------------------------------------------|-------------------------
as above, but "piped" (scrolls one screen at a time) | ls -al | more
-----------------------------------------------------|-------------------------
Change directory:                                    |
   Absolute                                          | /cd directory name
   Relative                                          | cd directory name
-----------------------------------------------------|-------------------------
Move up one level in a directory structure           | cd ..      OR     cdup
-----------------------------------------------------|-------------------------
Display text of specific file, pausing screen by scr.| get filename|more
-----------------------------------------------------|-------------------------
Transfer or copy file from FTP host to CUNIX         | get filename
(+ see note about binary files)                      |
-----------------------------------------------------|-------------------------
Transfer multiple files from ftp host to CUNIX:      | 
   Using multiple filenames                          |mget filename filename...
   Using wildcards (*) to substitute for some char-s.| mget *.txt
-----------------------------------------------------|-------------------------
Check space available in your CUNIX account          | quota -v
-----------------------------------------------------|-------------------------
Exit FTP session                                     | quit
===============================================================================
Some larger FTP files can occupy considerable space, so make sure that you have enough space available for the file(s) you are retrieving before you launch your FTP session. Use the quota -v command to check your space quota and overall usage on your CUNIX file. Then use the pwd command to find the full name of your home directory; then match that name with the correct line of the display shown with your quota -v display. The usage, quota, and limit columns are measured in kilobytes.

If what you want is bigger than the space you have available, then you can use the scratch directory to temporarily store larger files. You must change your directory before you begin your FTP session: type cd /scratch at the UNIX prompt.
After you are finished, download these files to your microcomputer using Kermit or a PC/Mac side FTP package and delete the files in /scratch.

There are many file types in FTP archives and they are usually tagged with an extension denoting the format. Some examples:

===============================================================================
Extension | File type     | Data type || Extension | File type      | Data type
==========|===============|===========||===========|================|==========
 .txt     | ASCII/text    | ASCII     ||  .doc     | ASCII/text     | ASCII
 .com     | program       | binary    ||  .exe     | program        | binary
 .ps      | postscript    | binary    ||  .Z       | (UNIX)compress | binary
 .zip     | (DOS)compress | binary    ||  .gif     | graphics       | binary
===============================================================================
If you are retrieving a binary file, type binary at the ftp> prompt before getting the file. To return to ASCII format, type ASCII at the ftp> prompt before getting the file. If you use Kermit to download files from CUNIX to your machine, start up Kermit on CUNIX with the kermit -i option, which signifies that you are transmitting a file in binary format, not in text format.


More Info: To access the online reference manual on FTP type man ftp at the UNIX prompt ($): man ftp
Last update: 8/11/95 -- About this document [IQG-2p]