FTP(1) — Series 300 and 800 Only
NAME
ftp − file transfer program
SYNOPSIS
ftp [ −g ] [ −i ] [ −n ] [ −v ] [ server-host]
DESCRIPTION
Ftp is a user interface to a subset of the File Transfer Protocol. Ftp transfers files over a network connection between the local “client” host and a remote “server” host. Ftp runs on the client host.
The ftp command supports the following options:
−g Disable file name “globbing”; see the glob command, below. By default, when this option is not specified, globbing is enabled.
−i Disable interactive prompting during multiple-file transfers; see the prompt command, below. By default, when this option is not specified, prompting is enabled.
−n Disable “auto-login”; see the open command, below. By default, when this option is not specified, auto-login is enabled.
−v Enable verbose output; see the verbose command, below. By default, when this option is not specified, ftp displays verbose output only if stdin is associated with a terminal.
The name of the server host that ftp communicates with may be specified on the command line. If the server host is specified, ftp immediately opens a connection to the server host; see the open command, below. Otherwise, ftp waits for commands from the user. The server host name can be the official name or an alias as listed in /etc/hosts; see hosts(4)).
Ftp processes file name arguments as follows: If the file name ‘-’ is specified, ftp uses stdin (for reading) or stdout (for writing). Otherwise, if globbing is enabled, ftp expands local file names according to the rules used by csh(1); see the glob command, below.
The File Transfer Protocol specifies many parameters that affect file transfers. Ftp supports the ascii, binary, and tenex File Transfer Protocol types. Ascii is the default FTP type. Ftp supports only the default values for the remaining file transfer parameters: mode, which defaults to stream; form, which defaults to non-print; and struct, which defaults to file.
FTP Commands
Ftp supports the following commands. Command arguments with embedded spaces must be enclosed in quotes (for example, "argument with embedded spaces").
! [ command ]
Invoke a shell on the local host. The SHELL environment variable specifies which shell program to invoke (for example, SHELL="/bin/sh", or SHELL="/bin/csh"). Ftp invokes “/bin/sh” if SHELL is undefined. If command is specified, the shell executes it and returns to ftp. Otherwise, the shell accepts commands from stdin. When the shell terminates, it returns to ftp.
append local-file [ remote-file ]
Transfer local-file to the end of remote-file. If remote-file is not specified or does not already exist, ftp uses the specified local-file name as the remote-file name.
ascii Set the FTP file transfer type to ascii. This is the default type.
bell Sound a bell after each file transfer completes.
binary Set the FTP file transfer type to binary.
bye Close the connection to the server host, if a connection was open, and exit ftp.
cd remote-directory
Set the working directory on the server host to remote-directory.
close Terminate the connection to the server host. The close command does not exit ftp.
delete remote-file
Delete remote-file. The remote-file can be an empty directory. No globbing occurs.
dir [ remote-directory [ local-file ] ]
Write a remote-directory listing to stdout, or optionally, to local-file. If neither remote-directory nor local-file is specified, list the remote working directory to stdout. Globbing characters are always expanded.
form format
Set the FTP file transfer form to format. The only supported form is non-print.
get remote-file [ local-file ]
Transfer remote-file to local-file. If local-file is unspecified, ftp uses the specified remote-file name as the local-file name.
glob Toggle file name globbing. When file name globbing is enabled, ftp expands csh(1) metacharacters in file and directory names. These characters are * ? [ ] ~ { } . The server host expands remote file and directory names. Globbing metacharacters are always expanded for the ls and dir commands. Metacharacters are also expanded for the following multiple (m) commands if globbing is enabled: mdelete, mdir, mget, mls, and mput.
hash Toggle hash-sign (#) printing for each data block transferred. The size of a data block is 1024 bytes.
help [ ftp-command ]
Print an informative message about the ftp command called ftp-command. If ftp-command is unspecified, print a list of all ftp commands.
lcd [ local-directory ]
Set the local working directory to local-directory. If local-directory is unspecified, set the local working directory to the user’s local home directory.
ls [ remote-directory [ local-file ] ]
Write an abbreviated listing of remote-directory to stdout, or optionally, to local-file. If neither remote-directory nor local-file is specified, list the remote working directory. If globbing is enabled, globbing metacharacters are expanded.
mdelete remote-files
Delete remote-files. If globbing is enabled, globbing metacharacters are expanded.
mdir remote-files local-file
Write a listing of remote-files to local-file. If globbing is enabled, globbing metacharacters are expanded.
mget remote-files
Transfer remote-files to the local system. If globbing is enabled, globbing metacharacters are expanded.
mkdir remote-directory
Create remote-directory.
mls remote-files local-file
Write an abbreviated listing of remote-files to local-file. If globbing is enabled, globbing metacharacters are expanded.
mode [ mode-name ]
Set the FTP file transfer mode to mode-name. The only supported mode is stream.
mput local-files
Transfer local-files from the local system to the remote system. The remote files have the same name as the local files. If globbing is enabled, globbing characters are expanded.
open server-host [ port-number ]
Establish a connection to server-host, using port-number (if specified). If auto-login is enabled, ftp attempts to log into the server host.
prompt Toggle interactive prompting. Interactive prompting occurs during multiple-file transfers to allow the user to selectively transfer files. If interactive prompting is disabled, then ftp transfers all specified files.
put local-file [ remote-file ]
Transfer local-file to remote-file. If remote-file is unspecified, ftp assigns the local-file name to the remote-file name.
pwd Write the name of the remote working directory to stdout.
quit A synonym for the bye command.
quote arguments
Send arguments, verbatim, to the server host. See ftpd(1M).
recv remote-file [ local-file ]
A synonym for the get command. Recv transfers remote-file to local-file. If local-file is unspecified, ftp uses the specified remote-file name as the local-file name.
remotehelp [ command-name ]
Request help from the server host. If command-name is specified, supply it to the server. See ftpd(1M).
rename remote-from remote-to
Rename remote-from, which may be either a file or a directory, to remote-to.
rmdir remote-directory
Delete remote-directory. Remote-directory must be an empty directory.
send local-file [ remote-file ]
A synonym for the put command. Send transfers local-file to remote-file. If remote-file is unspecified, ftp assigns the local-file name to the remote-file name.
sendport Toggle the use of PORT commands. By default, ftp attempts to use a PORT command when establishing a connection for each data transfer. If the PORT command fails, ftp uses the default data port. When the use of PORT commands is disabled, ftp makes no attempt to use PORT commands for each data transfer. This is useful for certain FTP implementations that ignore PORT commands, but (incorrectly) indicate that they’ve been accepted. See ftpd(1M). Turning sendport off may cause delays in the execution of commands.
status Write the current status of ftp to stdout.
struct [ struct-name ]
Set the FTP file transfer struct to struct-name. The only supported struct is file.
tenex Set the FTP file transfer type to tenex.
type [ type-name ]
Set the FTP file transfer type to type-name. If type-name is unspecified, write the current type to stdout. Ascii, binary, and tenex are the types currently supported.
user user-name [ password ] [ account ]
Log into the server host on the current connection, which must already be open. The HP-UX FTP server ( ftpd(1M)) accepts only one login per connection. To change to a different remote user account, you must close the current connection and open a new one. A .netrc file in the user’s local home directory may provide the user-name, password, and optionally the account; see netrc(4). Otherwise ftp prompts the user for this information. HP-UX does not require an account. For system security reasons, ftp always requires a password. It will not log into remote accounts that do not have a password.
verbose Toggle verbose output. When verbose output is enabled, ftp displays responses from the server host. When a file transfer completes and verbose is enabled, ftp reports statistics regarding the efficiency of the transfer.
? [ command ]
A synonym for the help command. Prints the help command information for the specified command.
DEPENDENCIES
Implemented on the Series 300 and 800 only.
AUTHOR
UCB (University of California at Berkeley)
SEE ALSO
rcp(1), ftpd(1M), netrc(4), ftpusers(4), hosts(4).
Hewlett-Packard Company — May 11, 2021