Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

FTP(1C)  —  Silicon Graphics

NAME

ftp − file transfer program

SYNOPSIS

ftp [ −v ] [ −d ] [ −i ] [ −g ] [ host ]

DESCRIPTION

ftp is the user interface to the ARPANET standard file transfer protocol.  It can transfer files to and from a remote network site. 

A remote host can be specified in the command line.  If specified, ftp immediately attempts to connect to a FTP server on that host; otherwise, ftp enters its command interpreter and awaits instructions from the user.  When ftp is awaiting commands, the prompt “ftp>” is displayed.  ftp recognizes the following commands:

append local_file [ remote_file ]
Append a local file to a remote file If remote_file is not specified, local_file copies under its original name.  The current settings for type, format, mode, and struct are used during file transfers. 

ascii Set the file transfer type to network ASCII (the default). 

bell Sound a bell after each file transfer command completes (toggle). 

binary
Set the file transfer type to support binary image transfer. 

bye Terminate the ftp session with the remote server, exit ftp command mode, and return to the operating system. 

cd remote_directory
Change the current working directory on the remote host to remote_directory. 

close Terminate the FTP session with the remote server but remain in ftp the command interpreter. 

debug [ debug_value ]
Toggle debugging mode. When debug_value is nonzero, debugging is on and ftp displays each command sent to the remote host. 

dir [ remote_directory ] [ local_file ]
List the contents of remote_directory on the remote host If remote_directory is not specified, the current working directory on the remote host is listed.  If local_file is not specified, the remote_directory listing is shown on the terminal. 

form format
Set the file transfer form to format.  The default format is “file.” This is the only format currently supported. 

get remote_file [ local_file ]
Copies remote_file from the remote host to the local system.  If remote_file is omitted, ftp prompts for the name.  If local_file is not specified, remote_file retains its original name when copied to the local machine.  If a - (hyphen) is specified for local_file, the file is displayed on the terminal.  If remote_file is specified as [directory_name].file_name, the file is copied to the local host under the same directory and file names.  The current settings for type, format, mode, and structure are used during file transfers. 

glob Toggle file name globbing.  When on, each local file or pathname is processed for csh(1) metacharacters.  These characters include *, ?, [, ], ~, {, and } .  Remote files specified in multiple item commands (for example, mput) are globbed by the remote server.  When off, all files and pathnames are treated literally.  Remote files specified in multiple-item commands (such as mget and mput) are globbed by the remote server.  When globbing is off, all files and pathnames are treated literally. 

hash Toggle printing a hash sign (#) for each data block (1024 bytes) transferred. 

help [ command ]
Lists all ftp commands.  If command is specified, on-line help documentation for that command is provided. 

lcd [ directory ]
Changes the current working directory on the local system to local_directory.  If local_directory is not specified, the user’s home directory becomes the current working directory. 

ldir [ directory ]
Gives a long listing of local_directory on the local host.  If local_directory is not specified, the contents of the current working directory are listed. 

lls [ directory ]
Lists the abbreviated contents of local_directory on the local host.  If local_directory is not specified, the contents of the current working directory are listed. 

lpwd Print the current working directory of the local host. 

ls [ remote_directory ] [ local_file ]
Lists the abbreviated contents of a directory on the remote host in local_file.  If remote_directory is not specified, the contents of the current working directory are listed.  If local_file is not specified, the remote_directory listing is shown on the terminal. 

mdelete remote_file1 [remote_file2 ...]
Deletes one or more files on the remote host. If globbing is enabled, remote_files is first expanded via ls. 

mdir remote_files local_file
Places directory information for a listing of one or more files from the remote host in local_file.  The last file in the file list is treated as local_file. 

mget remote_files
Places one or more files from the remote host in the current working directory on the local host. If globbing is enabled, remote filenames are expanded via ls. 

mkdir remote_directory
Creates remote_directory on the remote host.  The directory must not already exist. 

mls remote_files local_file
Place abbreviated directory information for one or more files on the remote host into local_file.  The last file in the file list is treated as local_file. 

mode [ mode_name ]
Set the file transfer mode to mode_name.  The default mode is “stream” mode.  This is the only mode currently supported. 

mput local_files
Copy one or more files from the local host to the current working directory on the remote host.

open host [ port ]
Establishes a connection to the specified host_name FTP server.  If port is specified ftp attempts to contact an FTP server at that port.  The default port for ftp is 21.  If the auto_login option is on (default), ftp also attempts to automatically log the user into the FTP server (see FTPD). 

prompt
Toggles interactive prompting. This allows the user to selectively retrieve or store files during multiple file transfers. When off (default), any mget or mput transfers all files. 

put local_file [ remote_file ]
Copies a file from the local system to the remote system. If remote_file is not specified, local_file is copied under its original name.  The current settings for type, format, mode, and structure are used during file transfers. 

pwd Display the name of the current working directory of the remote host. 

quit Terminate the ftp session with the remote server, exit ftp command mode, and return to the operating system. 

recv remote_file [ local_file ]
Same as the get command. 

remotehelp [ command_name ]
Display help documentation from the remote FTP server. If command_name is specified, help for that command is provided. 

rename remote_file1 remote_file2
Rename remote_file1 to remote_file2. 

rmdir remote_directory
Delete the remote_directory.  The remote directory must be empty before it can be deleted. 

send local_file [ remote_file ]
Same as the put command. 

sendport
Toggles the use of port commands. When sendport is on (default), ftp attempts to use the port specified by the client when establishing a connection for each data transfer.  If this fails, ftp uses the default data port (port 21).  When sendport is off, ftp uses the default port.  This is useful for certain FTP implementations that ignore port commands, but incorrectly indicate that they have been accepted. 

status
Display the current state of all ftp options. 

struct [ struct_name ]
Set the file transfer structure to struct_name.  The default structure is “stream.” This is the only structure currently supported. 

type [ type_name ]
Set the file transfer type to type_name.  If type_name is not specified, the current type is printed.  Network ASCII is the default type.  The other type is image (binary). 

user user_name [ password ] [ account ]
Identifies the user to the remote FTP server. If password is not specified and one is required by the server, ftp prompts the user for one (after disabling local echo).  If account is not specified and one is required by the server, ftp prompts the user.  Unless ftp is invoked with auto_login disabled, this process occurs when first connecting to the FTP server. 

verbose
Toggle verbose mode. When on (default when ftp is used interactively), all responses from the FTP server are displayed, and statistics on the efficiency of the file transfer are reported. 

? [ command ]
Same as the help command. 

Embedded spaces in command arguments can be quoted with quotation marks ("). 

FILE NAMING CONVENTIONS

Files that are arguments to ftp commands are processed as follows:

•If the filename "-" is specified, the stdin (reading) or stdout (writing) is used. 

•If globbing is enabled, local file names are expanded according to the rules used by the local command interpreter.  For UNIX, this is csh(1); c.f. glob. 

FILE TRANSFER PARAMETERS

The FTP specification lists many parameters that may affect a file transfer.  The type can be “ascii,” “image” (binary), “ebcdic,” and “local byte size” (PDP-10’s and PDP-20’s).  ftp supports the ascii and image types of file transfer. 

ftp supports only the defaults for the remaining file transfer parameters:  mode, form, and struct. 

OPTIONS

Options can be specified in the command line or to the command interpreter. 

The −v option shows all responses from the remote server and reports data transfer statistics.  This is the default if ftp is used interactively. 

The −i option turns off interactive prompting during multiple file transfers. 

The −d option enables debugging. 

The −g option disables filename globbing. 

BUGS

Many FTP server implementations do not support experimental operations, such as pwd.  Aborting a file transfer does not work correctly; if attempted, the local ftp will likely have to be killed. 

Version 2.4  —  September 29, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026