tftp - Man Page
Trivial File Transfer Protocol (TFTP) client
Examples (TL;DR)
- Connect to a TFTP server with an interactive shell, specifying its IP address and port:
tftp server_ip port - Connect to a TFTP server and execute a TFTP [c]ommand:
tftp server_ip -c command - Connect to a TFTP server using IPv6 and force originating port to be in [R]ange:
tftp server_ip -6 -R port:port - [Interactive] Set the transfer mode to binary or ASCII through the tftp client:
mode binary|ascii - [Interactive] Download file from a server through the tftp client:
get file - [Interactive] Upload file to a server through the tftp client:
put file - [Interactive] Exit the tftp client:
quit
Synopsis
tftp [ options... ] [host [port]] [-c command]
Description
tftp is a client for the Trivial file Transfer Protocol, which can be used to transfer files to and from remote machines, including some very minimalistic, usually embedded, systems. The remote host may be specified on the command line, in which case tftp uses host as the default host for future transfers (see the connect command below.)
Options
- -4, --ipv4
Connect with IPv4 only, even if IPv6 support was compiled in.
- -6, --ipv6
Connect with IPv6 only, if compiled in.
- -c, --command command
Execute command as if it had been entered on the tftp prompt. Must be specified last on the command line.
- -l, --literal
Default to literal mode. Used to avoid special processing of “:” in a file name.
- -m, --mode mode
Set the default transfer mode to mode. mode can be either netascii (convert line endings) or octet (direct binary transfer without any conversions.)
This is usually used with -c.
- -a, --ascii, --netascii, --text
Equivalent to --mode netascii.
- -b, --binary, --octet
Equivalent to --mode octet.
- -B, --blocksize block-size
Request the RFC 2348 blksize option. This requests data blocks up to block-size bytes; valid values are 8 through 65464. The default does not request the option.
- -W, -w, --windowsize window-size
Request the RFC 7440 windowsize option. This permits up to window-size data blocks to be sent before an acknowledgment is required. Valid values are 1 through 32768. The default does not request the option.
- -R, --port-range min-port:max-port
Force the originating (local) port number to be in the specified range of port numbers.
- -v, --verbose[=level]
Default to verbose mode. At level 2 or higher, do not round byte counts in statistics or use suffixes.
- -V, --version
Print the version number and configuration to standard output, then exit gracefully.
- -h, --help
Print a usage summary and exit.
Commands
Once tftp is running, it issues the prompt tftp> and recognizes the following commands:
- ? command-name...
- help command-name...
Print help information
- ascii
Shorthand for mode ascii.
- binary
Shorthand for mode binary.
- connect host [port]
Set the host (and optionally port) for transfers. Note that the TFTP protocol, unlike the FTP protocol, does not maintain connections between transfers; thus, the connect command does not actually create a connection, but merely remembers what host is to be used for transfers. You do not have to use the connect command; the remote host can be specified as part of the get or put commands.
- get file
- get remotefile localfile
- get file1 file2 file3...
Get a file or set of files from the specified sources. A remote filename can be in one of two forms: a plain filename on the remote host, if the host has already been specified, or a string of the form host:filename to specify both a host and filename at the same time. If the latter form is used, the last hostname specified becomes the default for future transfers. Enable literal mode to prevent special treatment of the ':' character (e.g. C:\dir\file).
- literal
Toggle literal mode. When set, this mode prevents special treatment of ':' in filenames.
- mode transfer-mode
Specify the mode for transfers; transfer-mode may be one of ascii (or netascii) or binary (or octet.) The default is ascii.
- blocksize block-size
Request the RFC 2348 blksize option with block-size bytes per data block. Valid values are 8 through 65464.
- put file
- put localfile remotefile
- put file1 file2 file3... 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 host:filename to specify both a host and filename at the same time. If the latter form is used, the hostname specified becomes the default for future transfers. If the remote-directory form is used, the remote host is assumed to be a UNIX system or another system using / as directory separator. Enable literal mode to prevent special treatment of the ':' character (e.g. C:\dir\file).
- quit
Exit tftp. End-of-file will also exit.
- rexmt retransmission-timeout
Set the initial per-packet retransmission timeout, in seconds. Each subsequent retry doubles this interval.
- status
Show current status.
- timeout total-transmission-timeout
Set the maximum retransmission interval, in seconds.
- windowsize window-size
Request the RFC 7440 windowsize option with window-size data blocks per window. Valid values are 1 through 32768.
- trace
Toggle packet tracing (a debugging feature.)
- verbose
Toggle verbose mode.
Notes
The TFTP protocol provides no provisions for authentication or security. Therefore, the remote server will probably implement some kinds of access restriction or firewalling. These access restrictions are likely to be site- and server-specific.
Author
This version of tftp is maintained by H. Peter Anvin <hpa@zytor.com>. It was derived from, but has substantially diverged from, an OpenBSD source base, with added patches by Markus Gutschke and Gero Kulhman.
See Also
Referenced By
in.tftpd(8), ncftp(1), ncftpget(1), ncftpls(1), ncftpput(1).