tftp

Updated: May 06, 2022

Trivial file transfer program

Syntax:

tftp [-e] [host] [port]

Runs on:

QNX Neutrino

Options:

-e
Use binary transfer mode and set the extended options, as if tout, tsize, and blksize 65464 had been given.
host
The host to connect to.
port
The port to connect to.

Description:

The tftp utility is the user interface to the Internet TFTP (Trivial File Transfer Protocol), which lets you transfer files to and from a remote machine. If you specify a remote host (and an optional port) on the command line, tftp uses that host (and port) as the default for future transfers (see the connect command below). The client host must have an entry in the /etc/services file to provide tftp service.

Note: Remote filenames must start with a /. If a list of directories is given to tftpd, filenames must be in that list. To get a file, the file must have world-read privileges; to put a file, the file must have world-write privileges on the remote machine.

Commands:

Once tftp is running, it issues a prompt and accepts the following commands:

? command_name...
Print help information.
ascii
Shorthand for mode ascii (see mode below).
binary
Shorthand for mode binary (see mode below).
blksize blk-size
Set the blocksize to blk-size octets (8-bit bytes). Since the number of blocks in a tftp get or put is 65535, the default block size of 512 bytes allows only a maximum of just under 32 MB to be transferred. The value given for blk-size must be between 8 and 65464, inclusive. Note that many servers don't respect this option.
connect host [port]
Set the host (and optionally port) for transfers. Note that the TFTP protocol, unlike FTP, doesn't maintain connections between transfers. That is, the connect command doesn't actually create a connection, but merely remembers what host to use for transfers. You don't have to use the connect command; you can specify the remote host as part of the get or put commands.
get file or get remotefile localfile or get file1 file2 ... fileN
Get a file or set of files from the specified sources. The source can be in one of two forms: a filename on the remote host (if the host has already been specified), or a string of the form hosts : filename to specify both a host and file at the same time. If you use the latter form, the last hostname specified becomes the default.
mode transfer_mode
Set the mode for transfers to either ascii or binary (default is ascii).
put file or put localfile remotefile or put file1 file2 ... fileN remote_directory
Put a file or set of files to the specified remote file or directory. The destination can be in one of two forms: a filename on the remote host (if the host has already been specified), or a string of the form hosts : filename to specify both a host and file. If you use the latter form, the hostname specified becomes the default; if you use the remote_directory form, the remote host is assumed to be a Unix box.

If you need to specify IPv6 numeric addresses for the hosts, enclose them in square brackets ([hosts]:filename) to disambiguate the colon.

quit
Exit tftp. An end-of-file also exits.
rexmt retransmission_timeout
Set the per-packet retransmission timeout (specified in seconds).
status
Show the current status.
timeout total_transmission_timeout
Set the total transmission timeout (specified in seconds).
tout
Toggle the timeout option. If you use this option, the client passes its retransmission-timeout to the server. Note that many servers don't respect this option.
trace
Toggle packet tracing.
tsize
Toggle the tsize option. If you enable this option, the client passes and requests the size of a file at the beginning of a file transfer. Note that many servers don't respect this option.
verbose
Toggle verbose mode.

Files:

The tftp utility requires the libsocket.so shared library.

Caveats:

Since there's no user-login or validation within the TFTP protocol, the remote site should have some file-access restrictions—the exact methods for implementing these vary.