ftp(1C) C2 Trusted DG/UX 5.4.2T ftp(1C)
NAME
ftp - transfer files between systems
SYNOPSIS
ftp [ -v ] [ -d ] [ -i ] [ -n ] [ -g ] [ host [port]]
DESCRIPTION
The ftp program is the user interface to the Internet standard File
Transfer Protocol (FTP). The program lets a user transfer files to
and from a remote network site.
You may specify the client host with which ftp is to communicate on
the command line. The ftp program will then try to establish a
connection to an FTP server on that host and enter the command
interpreter. Otherwise, ftp will enter its command interpreter and
await instructions.
Options
The -v (verbose on) option forces ftp to show all responses from the
remote server, as well as report on data transfer statistics. If ftp
is invoked from the terminal, the verbose option is on by default.
The -n option keeps ftp from attempting auto-login upon initial
connection. You must use the user command. If auto-login is
enabled, ftp will check the .netrc file in the user's home directory
for an entry listing a login, password, and account for the remote
machine. (Because the .netrc file contains your username and
passwords, ftp requires you to restrict access to this file. To
restrict access to yourself only, set your access mode to 600.) The
sample .netrc entry
machine remote1 login gerry password fastcar
with the username gerry and the password fastcar will allow you to
auto-login to remote1.
If no entry exists in the .netrc file, ftp will provide as a default
the user name associated with the real user ID on the local machine
as the user identity on the remote machine. For example, if you had
used su(1) to become root, ftp would provide root as the default name
rather than your login name. Then, ftp will prompt for a password
(if required) and, optionally, will prompt for an account with which
to log in. If the remote system is running Trusted DG/UX, the user
must be specifically authorized to use ftp.
The -i option turns off interactive prompting during multiple file
transfers.
The -d option enables debugging.
The -g option disables filename globbing.
When ftp is awaiting commands from the user, it shows a prompt: ftp>.
If you omit one or more arguments to a command, ftp will generally
Licensed material--property of copyright holder(s) 1
ftp(1C) C2 Trusted DG/UX 5.4.2T ftp(1C)
either prompt for the arguments one at a time or print a "help"
message that explains the correct way to use the command. The ftp
program recognizes the following commands:
abort Abort the previous file transfer command. If abort is
invoked when a data transfer has been interrupted,
output from the transfer is aborted. The data
connection closes and a reply is sent to the user
indicating that the service request terminated
abnormally.
account account-number
Send an account number for a system logon or access to
a specific process. During the login procedure, ftp
automatically prompts you for your account number if
one is needed.
append local-file [ remote-file ]
Append a local file to a file on the remote machine.
If remote-file is left unspecified, the local filename
is used in naming the remote file. If remote-file
does not exist, it will be created. File transfer
uses the current settings for type, mode, and
structure.
bell Sound a bell after some of the file transfer commands
are completed.
binary Set the file transfer type to binary. You should use
binary type for any non-text files such as executable
programs or object files, compressed files, and tar or
cpio files to ensure data integrity during transfer.
This command is the same as the type binary and type
image commands.
bye Terminate the file transfer session with the remote
server and exit ftp.
cd remote-directory
Change the working directory on the remote machine to
remote-directory.
cdup Change the working directory on the remote machine to
the parent directory.
close Terminate the file transfer session with the remote
server and return to the local command interpreter.
delete remote-file
Delete the file remote-file on the remote machine.
debug [ debug-value ]
Toggle debugging mode. If you specify an optional
debug-value, it is used to set the debugging level.
Licensed material--property of copyright holder(s) 2
ftp(1C) C2 Trusted DG/UX 5.4.2T ftp(1C)
Setting the debug level to zero turns debugging off;
setting it to any other value turns debugging on.
When debugging is on, ftp prints each command sent to
the remote machine, preceded by the string lq-->.
CAUTION: We cannot guarantee that all commands will function
normally in debug mode. Expect some unusual results.
dir [ remote-directory [ local-file ] ]
Print a listing of the directory contents in the
directory remote-directory and, optionally, place the
output in local-file. If no directory is specified,
the current working directory on the remote machine is
used. If no local file is specified, output comes to
the terminal. If the remote directory does not exist,
nothing is returned.
disconnect A synonym for close.
exit Abruptly terminate the FTP session and exit.
get remote-file [ local-file ]
Retrieve the remote-file and store it on the local
machine. If the local filename is not specified, it
is given the same name it has on the remote machine.
The current settings for type, mode, and structure are
used while transferring the file.
glob Toggle filename globbing. With filename globbing
enabled, each local file or pathname is processed for
csh(1) metacharacters. These characters include
*?[]~{}. Remote files specified in multiple item
commands, e.g., mget, are globbed by the remote
server. With globbing disabled all files and
pathnames are treated literally.
hash Toggle hash-sign (#) printing for each data block
transferred. The size of a data block is 2048 bytes.
help [ command ]
Print an informative message about the meaning of
command. If no argument is given, ftp prints a list
of the known commands.
lcd [ directory ]
Change the working directory on the local machine. If
no directory is specified, the user's home directory
is used.
ls [ remote-directory [ local-file ] ]
Print an abbreviated listing of the contents of a
directory that is on the remote machine. If remote-
directory is left unspecified, the current working
directory is used. If local-file is specified, the
Licensed material--property of copyright holder(s) 3
ftp(1C) C2 Trusted DG/UX 5.4.2T ftp(1C)
listing is put there; otherwise, the output is sent to
the terminal.
mdelete remote-files
Delete the specified files on the remote machine. If
globbing is enabled, the specification of remote files
will first be expanded using ls.
mdir remote-files local-file
Obtain a directory listing of multiple files on the
remote machine and place the result in local-file.
mget [ remote-files ]
Retrieve the specified files from the remote machine
and place them in the current local directory. If
globbing is enabled, the specification of remote files
will first be expanded using ls. If no files are
specified, mget prompts for them.
mkdir [ directory-name ]
Make a directory on the remote machine. If directory-
name is not specified, mkdir prompts you. If the
directory already exists, mkdir tells you. It will not
overwrite an existing directory.
mls [ remote-files [local-file] ]
Obtain an abbreviated listing of multiple files on the
remote machine and place the result in local-file. If
no files are specified, mls prompts you. If local-
file does not exist, it is created.
mode [ mode-name ]
Set the file transfer mode to mode-name. If you do
not specify a mode-name, mode displays the current
mode. Three modes are available: block, compressed,
and stream. The following table defines the available
modes:
Mode Meaning
stream Transmits data as a stream of bytes without
any restrictions on the type used. This is
the default mode.
block File is transmitted as a series of data
blocks, each preceded by three header bytes.
You can use record structures and any
representation type in this mode.
compress Sends regular data, compressed data, and
control information. Regular data is sent
in a byte string, compressed data is sent in
replications or fillers, and control
information is sent in a two-byte sequence.
Licensed material--property of copyright holder(s) 4
ftp(1C) C2 Trusted DG/UX 5.4.2T ftp(1C)
mput [ local-files ]
Transfer multiple local files from the current local
directory to the current working directory on the
remote machine. If you do not specify local-files,
mput prompts you for them. If a file does not exist,
mput will give you an error message and continue.
open host [ port ]
Establish a connection to the specified host FTP
server. An optional port number may be supplied, in
which case ftp will try to contact an FTP server at
that port. If the auto-login option is on (default),
ftp will also try to automatically log the user in to
the FTP server (see above).
prompt Toggle interactive prompting. Interactive prompting
occurs during multiple file transfers to let the user
selectively retrieve or store files. If prompting is
turned off, any mget or mput will transfer all files
without interruption.
put local-file [ remote-file ]
Store a local file on the remote machine. If remote-
file is left unspecified, the local filename is used
in naming the remote file. File transfer uses the
current settings for type, mode, and structure. If
remote-file already exists, it is overwritten.
pwd Print the name of the current working directory on the
remote machine.
quit A synonym for bye.
quote arg1 arg2 ...
Specified arguments are sent, verbatim, to the remote
FTP server. A single FTP reply code is expected in
return. This command is usually used for debugging or
for working around local restrictions.
recv remote-file [ local-file ]
A synonym for get.
reinit Terminate the user and reinitialize the command
connection. Resets all transfer parameters to their
default values. The command connection remains open.
remotehelp [ command-name ]
Request help from the remote FTP server. If a
command-name is specified, a more informative message
about the command-name is given. If no command-name
is specified, the remote server displays a list of
known commands.
Licensed material--property of copyright holder(s) 5
ftp(1C) C2 Trusted DG/UX 5.4.2T ftp(1C)
rename [ from ] [ to ]
Rename the file from on the remote machine, to the
file to. If no names are specified, rename prompts
you for them. If from does not exist, an error is
reported; if from is specified but to is not, rename
shows you a syntax description. If the to file
already exists, it is overwritten.
restart Restart the last transfer aborted by a system crash.
The transfer restarts where it was aborted.
CAUTION: Only files transferred in compress or block transfer
mode can be restarted. You must use restart before
you begin any other data transfer.
rmdir directory-name
Delete a directory on the remote machine.
runique Toggle the use of unique naming of files transferred
from other systems. When on, if a file on the local
machine has the same name as the file transferred, a
number is appended to the filename of the transferred
file. The numbers assigned per transfer run
consecutively from 1-99. runique is off by default.
send local-file [ remote-file ]
A synonym for put.
sendport Toggle the use of port commands. By default, ftp
tries to use a port command when establishing a
connection for each data transfer. If the port
command fails, the default data port will be used.
When port commands are disabled, no attempt will be
made to use them for each data transfer.
site Display information about the remote system. The
DG/UX system supplies the following format:
Operating System: DG/UX
Storage Structure: File
Storage Representation Type: ascii
Storage Filler: NULL
Local byte size allowed: multiple of 8 bits
Default Page size: 2048 bytes
can be changed using PAGE command
Default EOR Delimiter: <NL>
can be changed using SEOR command
status Show the current status of the local and remote
environments. Displays the current values for the
transfer parameters (mode, type, format, and
structure) and modes (verbose, bell, prompt, hash,
globbing, sendport, runique, and sunique ).
Licensed material--property of copyright holder(s) 6
ftp(1C) C2 Trusted DG/UX 5.4.2T ftp(1C)
struct [ s-name ]
Set the file transfer structure to s-name. The
default structure is file. The table below lists the
file transfer structures and what they mean:
Structure Meaning
file There is no internal structure. The file is
a continuous sequence of bytes.
page The file is made up of independent indexed
pages.
record The file is made up of sequential records.
The DG/UX operating system does not support record structured files.
If you specify record structure, all EOR delimiters will be converted
to <NL> for storage.
page structure will be accepted with only the Local Byte type and is
supported only in the stream mode (see type command below).
sunique Toggle the use of unique naming of files transferred
to other systems. When on, if a file on the remote
machine has the same name as the file transferred, a
number is appended to the filename of the transferred
file. The numbers assigned per transfer run
consecutively from 1-99. sunique is off by default.
type [ t-name [vertical-format] ]
Set the file transfer type to t-name. If no type is
specified, the current type is printed. The default
type is network ASCII. If you include the t-name, the
type is set to t-name. T-name is the character
transfer type.
Some transfer types have formats. Choose the formats
by substituting a string for vertical-format. See the
following table for the transfer types and available
vertical-formats:
Type Vertical-formats
ascii [ non-print | telnet | carriage-control ]
ebcdic [ non-print | telnet | carriage-control ]
binary
image
local-byte [ bytesize ]
NOTE: bytesize must be a multiple of 8 bits.
The binary transfer type is the same as the image transfer
type and the binary command.
Licensed material--property of copyright holder(s) 7
ftp(1C) C2 Trusted DG/UX 5.4.2T ftp(1C)
Do not use type ascii to transfer binary files; data may be
lost due to the carriage-return and newline translation
between the server (ftpd) and the client (ftp). Use type
binary for any non-text files such as executable programs
or object files, compressed files, and tar or cpio files.
The vertical-format determines the vertical controls and
how the information is represented on a printing device.
The default vertical-format is non-print. The following
list defines the vertical-formats:
Vertical-format Description
non-print The file need not contain vertical
format information. A printer process
can assume standard values for spacing
and margins. Typically, this format is
used with files that will be stored or
processed.
telnet format controls The file contains ASCII/EBCDIC vertical
format controls, such as <CR>, <LF>, and
<FF>, that the printer process can
interpret. The sequence <CRLF> denotes
the end-of-line.
carriage-control The file contains American National
Standards Institute (ANSI) FORTRAN
vertical format control characters. If
lines and records are formatted
according to the ANSI standard, vertical
format controls are read in before the
data is printed.
user username [ password [ account ] ]
Identify yourself to the remote FTP server. If the
password is not specified and the server requires it,
ftp will prompt the user for it (after disabling local
echo). If an account field is not specified, and the
FTP server requires it, the user will be prompted for
it. Unless ftp is invoked with auto-login disabled
(-n option), this process is done automatically on
initial connection to the FTP server.
If the remote system is running Trusted DG/UX, the
user command cannot be executed when ftp is invoked
with auto-login enabled. If ftp is invoked with auto-
login disabled, the user command can be executed only
once during an ftp session. In this case, you must
start another session to change users.
verbose Toggle verbose mode. In verbose mode, all responses
from the FTP server are displayed to the user. If
verbose is on when a file transfer completes,
statistics on the efficiency of the transfer are
reported. Verbose mode is on by default when ftp is
invoked from a terminal.
Licensed material--property of copyright holder(s) 8
ftp(1C) C2 Trusted DG/UX 5.4.2T ftp(1C)
? [ command ] A synonym for help.
! Invoke a shell on the local machine.
Command arguments that have embedded spaces may be enquoted with
quote (") marks.
File Naming Conventions
Files specified as arguments to ftp commands are processed according
to the following rules:
1) If the filename "-" is specified, stdin (for reading) or
stdout (for writing) is used.
2) If the first character of the filename is a vertical line (|),
the rest of the argument is interpreted as a shell command.
ftp then forks a shell, using popen(3S) with the argument
supplied, and reads or writes from the stdout or stdin,
respectively. If the shell command includes spaces, the
argument must be enquoted; e.g., "| ls -lt".
3) Failing the above checks, if globbing is enabled, local
filenames are expanded according to the rules used in csh(1).
File Transfer Parameters
Several parameters control the transmission and the representation of
data as the data is transferred. These transfer parameters are mode,
structure, and type. Mode defines how the data bits are transferred,
while structure, and type define how the data is represented as it is
being transferred. For more information about these parameters, see
the commands mode, type, and struct above.
If you want a transferred file to be identical to the original file,
make sure the transfer parameters are appropriately set before
transferring the file.
Interrupting a File Transfer
FTP allows you to interrupt a file transfer that is in progress. To
interrupt a file transfer, enter the interrupt process character.
The interrupt character can be different from system to system (for
DG/UX, the interrupt character is usually ^C). The interrupt
character suspends the data transfer and displays a menu on the
screen. The menu lists the commands available. All menu commands
except help exit the menu upon completion.
Licensed material--property of copyright holder(s) 9
ftp(1C) C2 Trusted DG/UX 5.4.2T ftp(1C)
The following table lists and explains the available commands.
Command Function
exit Terminates the FTP-user process.
abort Aborts data transfer, closes data
connection, but leaves command
connection open.
quit Completes data transfer, closes
data connection, terminates user,
and closes command connection.
reinit Completes data transfer,
terminates user, but leaves the
command connection open.
status Displays status information and
continues data transfer.
continue Continues the transfer.
help [command] Displays available commands or
syntax for one of the available
commands.
SEE ALSO
rcp(1C), tftp(1C), inet(3N), hosts(4).
Trusted Facility Manual for the C2 Trusted DG/UX (Trademark) System
(093-701110)
BUGS
Many FTP server implementations that you might connect with do not
support experimental operations such as print working directory; they
also may not work correctly if data transfer is interrupted.
Errors are not handled consistently, especially in the mdelete, mdir,
mget, and mput commands. Before executing a command, check to see
that the files you want to transfer exist. Also, after executing a
command, check to see that the file transfer was successful.
Licensed material--property of copyright holder(s) 10