UP ONE LEVEL: ENEL 315 Home Page

Introduction to ftp
ENEL 315 Lab Tip, Winter 1998

This is NOT a course handout - to save paper, no paper copies have been printed.

Author: Steve Norman
Last modified: Mon Feb 9 01:29:46 MST 1998

Contents


Introduction

The main purpose of the ftp program is to allow copying of files from one computer system to another over a network.

There are two main ways of using ftp:

  1. A session where you have accounts on the systems at both ends of the ftp connection.
  2. An `anonymous ftp' session, where you are downloading files made available to the public on some remote system.
This Web page will concentrate on sessions of the first type.

ftp can also be used to copy files from one account to another on a single computer. On Unix systems, this helps students working on a group projects, by allowing them to exchange files without having to change permissions on files.

ftp is available on Windows NT - just start up a Command Prompt window, and type in commands as if you were using Unix.

[back to top of document]


Making a Connection

To connect to a remote computer, start by typing the command
ftp remote-computer
to the Unix shell prompt. For example, if you are logged in to an ENGG machine and want to make an ftp connection to the ENEL machine red04, the command would be
ftp red04.enel
You will then be asked by ftp for your username and password on the remote computer.

[back to top of document]


Basic Commands

Here is a little bit of terminology: This is far from a complete list. See a good Unix reference book for information about advanced features. Two other useful commands are mget and mput, which allow transfer of many files with a single command. See a Unix book or the ftp manual page for details.

[back to top of document]


A Simple Example Session

Suppose you are a user with a real-life name of John Q. Ampere, with an ENGG account under the name jqampere, and an ENEL account under the name amperej. Suppose further that you want to copy the file
~/enel315/lab22/foo.cpp
from the ENEL system to the directory ~/enel315/lab22 in the ENGG system. (Remember that ~ is shorthand for your own home directory on a Unix system.)

There are many different ways to do this with ftp. Here is one way:

  1. Log in to an ENGG computer as jqampere
  2. Before establishing an ftp connection, use
    cd enel315/lab22
    to get into the right directory on the ENGG computer.
  3. Start an ftp session with the command
    ftp red07.enel.ucalgary.ca
  4. When prompted for a username and password, enter amperej (your ENEL username) and your ENEL password.
  5. Use the command
    cd enel315/lab22
    to get into the correct directory on the ENEL machine.
  6. Use the command
    dir
    to make sure that the file you want to copy is where you thought it was.
  7. Use the command
    get foo.cpp
    to copy the file.
  8. Use the command
    quit
    to end the ftp session.

[back to top of document]


For More Information

For more information, use the Unix command man ftp to read the online manual page, or consult one of the Unix reference books available in the computer labs.

[back to top of document]