Personal tools
You are here: Home LIONS2 Documentation Tutorials How To FTP To LIONS

How To FTP To LIONS

The following document is a work in progress on how to use FTP to transfer files to and from the LIONS environment.

Summary

This document explains how to use the File Transfer Protocol (FTP), which is the standard method of copying files from one machine onto another across the Internet. FTP is in common use for downloading data and programs from servers, and for uploading Web sites.

Please note that this document assumes you are completely familiar with using your computer and operating system, and that you know and understand files, folders (directories), Web sites, URLs, and usernames/passwords.

How to use FTP

Graphical FTP clients

Using graphical FTP clients simplifies file transfers by allowing you to transmit files by dragging and dropping icons between windows. When you open the program, enter the name of the FTP host (e.g., ftp.lions.odu.edu) and your username and password. If you are logging into an anonymous FTP server, you may not have to enter anything. Two common FTP programs are Transmit (for Mac OS) and Hummingbird FTP (for Windows).

Web browser

You can use a web browser to connect to FTP addresses exactly as you would to connect to HTTP addresses. Using a web browser for FTP transfers makes it easy for you to browse large directories and read and retrieve files. Your web browser will also take care of some of the details of connecting to a site and transferring files. While this method is convenient, web browsers are often slower and less reliable and have fewer features than dedicated FTP clients.

Please note that if you are using Internet Explorer older than version 6.0, there is a security issue in which your username and password are displayed in the browser window in clear text. Please see this Microsoft KnowledgeBase article for more information. For this reason, we suggest that you do not use Internet Explorer to access FTP sites.

To use your web browser to connect to an FTP site such as ftp.lions.odu.edu, where you normally enter a URL, enter:

ftp://username@ftp.lions.odu.edu/

Command line FTP

You can also use FTP in a command line format from your UNIX LIONS account or from a Windows command window. For example, to start FTP, at the command line prompt, enter:

ftp ftp.lions.odu.edu

The FTP site will prompt for your username. Type in your username (in this case, we type foobar - please use yours instead!) and press Enter.

Connected to ftp.lions.odu.edu.
220 ProFTPD 1.2.10 Server (LIONS FTPD) [128.82.198.31]
Name (ftp.lions.odu.edu:user): foobar

You will be asked for your password:

331 Password required for foobar.
Password:       

Type that in and press Enter (it will not display anything, for security reasons).

If you are making an anonymous connection to download public files, you must use the username anonymous and give your email address as the password.

If you got it wrong, you will have to type:

quit

and start over. If you got it right, you will be logged in and FTP will display some words of welcome and respond with the ftp> prompt.

230 User foobar logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

Navigating Around The File System

To see a list of files and folders in the current server directory, type the dir command. For example:

ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 993
dr-xr-xr-x 2 root system 512 Nov 21 01:07 bin
-rw-r--r-- 1 root ftp 991232 Feb 20 16:19 core
dr-xr-xr-x 3 root system 512 Dec 02 10:45 etc
-rw-r--r-- 1 root daemon 1915 Feb 27 13:00 index.html
drwxrwsr-x 3 root 200 512 Nov 25 10:14 noc
drwxr-xr-x 3 root system 512 Nov 17 15:44 part1
drwxr-xr-x 6 root system 512 Nov 17 15:43 part2
drwxr-xr-x 3 root system 512 Jan 12 16:03 part3
drwxr-xr-x 6 root system 512 Oct 21 19:20 part4
drwxr-xr-x 4 root system 512 Jan 11 12:02 part5
drwxr-xr-x 3 root system 512 Feb 03 11:45 part6
drwxr-xr-x 3 root system 512 Feb 03 11:46 part7
drwxr-xr-x 7 root system 512 Feb 13 09:37 pub
drwxr-xr-x 4 root system 512 Dec 02 10:45 usr
226 Transfer complete.
1054 bytes received in 0.22 seconds (4.8 Kbytes/s)
ftp>

To change directories on the server, type

cd directoryname

Subdirectories (folders) are indicated with a letter d in the first character position on the line. If you lose track of where you are, type the following command to show the current working directory on the server:

pwd

To go back up to the previous directory level, type

cd ..

To change the local directory (the one where you originally typed the ftp command), type

lcd directoryname

Downloading/Uploading Files

To send a file from your current (local) directory to the server (into its current directory) type

put filename

To get a file from the server's current directory into your current local directory, type

get filename

Quitting FTP

To leave the FTP client, type:

quit

at the ftp> prompt.


Useful FTP Commands

These FTP commands are available on most systems.

ascii Switch to ASCII mode. ASCII mode is the default mode; use it for transferring text files.
binary Switch to binary mode. Use to transfer binary files, including files ending in .zip, .tar, .Z, and .gz, executable programs, and graphics files.
bye (or quit) Close the connection to the remote computer and exit FTP.
cd Change the directory on the remote computer.
close Close the connection to the remote computer.
del Delete files from the remote computer.
dir (or ls) List the files in the current directory on the remote computer.
get Copy a file from the remote computer to the local computer.
hash Displays a # on the screen for every block of bytes transferred. A block is 1024 bytes in some cases, 2048 in others, but is between 1024 and 4096 in most cases. Check FTP's online help for the number represented in the FTP program you are using.
help (or ?) Lists or provides help on the use of FTP commands.
lcd Change the directory on the local computer.
lpwd Show the current directory (present working directory) on the local computer. This command is not available in all FTP versions. On Unix systems, try !pwd if lpwd doesn't work.
mdel Delete multiple files on the remote computer.
mget Copy multiple files from the remote computer to the local computer.
mkdir Create a directory on the remote host.
mput Copy multiple files from the local computer to the remote computer.
open Open a connection to a remote computer.
prompt Turn on (or turn off) file transfer prompting. Often used to turn off prompting when using mdel, mput, or mget so that you are not required to confirm the transfer of each file before it is transferred.
put Copy a file from the local computer to the remote computer.
pwd Show the current directory (present working directory) on the remote computer.
rmdir Remove a directory on the remote host (the directory usually has to be empty).
user Log into the remote computer to which you are currently connected. FTP will ask for a login name and possibly a password.
! In Unix, exit to the shell prompt, where you can enter commands. Enter exit to get back to FTP. If you follow ! with a command (e.g., !pwd), FTP will execute the command without dropping you to the Unix prompt.


Document Actions