This guide gives some basic introduction to using FTP with the CEDA archives. Fuller FTP guides are readily available on the internet should users require additional information.
CEDA have also put together a short guide on using FTP within Perl or Python scripts available here.
This guide is made of the following elements:
- FTP: the basics
- Finding your way in the CEDA archive
- Managing files in your requests directory via FTP
The FTP commands you will use most frequently are:
- ftp - starts FTP. If a machine is specified, a connection to that machine is made immediately, e.g. ftp.ceda.ac.uk, otherwise the FTP command prompt is displayed.
- open - opens a connection to the specified machine.
- cd - change directory on the remote machine.
- lcd - change directory on the local machine.
- pwd - print working directory on the remote machine.
- ls - short directory listing on the remote machine.
- lls - short directory listing on the remote machine.
- dir - long directory listing on the local machine.
- ascii - set ascii transfer type (for text files).
- binary (or image) - set binary transfer type (for binary data, executable files, gzipped files etc.).
- get - copy file from the remote machine to the local machine, or append "-" after the filename to display the contents of a remote file on your screen (e.g. the command get 00README - will display the 00README file of the current directory to your local screen).
- put - copy file from the local machine to the remote machine.
- mget - as for get, but copies multiple files.
- mput - as for put, but copies multiple files.
- close - disconnects from the remote machine.
- quit - terminate FTP session and exit.
The example below (connecting from an Unix machine) shows the use of a number of the simple FTP commands to log on to ftp.ceda.ac.uk, move around the file system and transfer a couple of files. Note the input from the user has been emphasised to distinguish it from the computer's output.
$ftp ftp.ceda.ac.uk Connected to ftp.ceda.ac.uk (126.96.36.199). 220 JASMIN BADC/NEODC FTP server Name (ftp.ceda.ac.uk:root): username 331 Password required for username Password: 230-Welcome to the CEDA ftp server (ftp2). This server provides read-only access to the CEDA data archives and users 'requests' areas. For help on using FTP, including how to administer your requests area, please see http://help.ceda.ac.uk For the latest CEDA news visit http://www.ceda.ac.uk/blog For further help, please contact CEDA support: firstname.lastname@example.org http://www.ceda.ac.uk/contact 230 User username logged in Remote system type is UNIX. Using binary mode to transfer files. ftp> ftp>ls (List files in top-level directory) 200 PORT command successful. 150 Opening ASCII mode data connection for file list badc neodc requests sparc 226 Transfer complete ftp>cd badc/toms (Go to the directory called badc/toms)
The README file will automatically display on screen
250 CWD command successful. ftp>ls (list the files in this directory) 200 PORT command successful. 150 Opening ASCII mode data connection for file list 00README data doc images software 226 Transfer complete. ftp>ASCII (change to ASCII mode for text file transfer) ftp>get 00README (transfer the file 00README to your machine) 200 PORT command successful. 150 Opening ASCII mode data connection for 00README (867 bytes). 226 Transfer complete. ftp: 886 bytes received in 0.00Seconds 886000.00Kbytes/sec. ftp>quit (exit FTP) 221 Goodbye.
3 - Managing files in your requests directory via FTP
If you wish to remove files or directories in your requests directory, you can do this through the ftp interface but on a different FTP server, namely ftp.ceda.ac.uk . You only need to navigate to the appropriate folder in your requests folder and then use the command delete filename; to remove a directory it will be rmd directoryname .