Ftp command help

Interactive viewing system manuals (man-s)

ftp – file transfer program

SYNTAX

The ftp command is the user interface to the standard
ARPANET (File Transfer Protocol or FTP) file transfer protocol.
ftp allows the user to transfer files to another computer
network and receive them from it.

FILES

message file for the current language
(See L ANG in environ

.)

USE

The following options can be set on the command line.

Teams

The ftp program accepts the following commands. Arguments
commands that contain spaces must be taken in
quotes (“).

Calls an interactive shell on
local machine. If arguments are given, the first one
regarded as a command to be
execute, and the rest as arguments to that command.

Synonym for the help command.

Executes the macro macro_name that was defined with
using the macdef command.
Arguments are passed to the macro without expansion.

Sends an additional password required by the remote
system to access resources after a successful
completion of registration. If no argument is given,
The user will be prompted to enter the account password
entries in input mode without display.

Appends local_file to a file on the remote machine.
If remote_file is not specified, the name of the local file
used to name the remote after execution
all changes determined by the ntrans settings or
nmap. When transferring a file, the current
type, format, mode and structure settings.

Sets the file transfer type to
ASCII. This transfer type is used by default.

Causes a beep to sound when the
each file transfer command.

Sets the file transfer mode to support
transmission of binary images.

Terminates the FTP session with the remote server and ends
ftp job. End of file will also terminate the session and result in
to exit the program.

Switches file name case change to
remote computer when running mget commands.
When case change is enabled (by default it is
disabled), files from a remote computer, in filenames
which all letters are capital (upper case),
are written to the local directory with letter conversion
to lowercase (lowercase).

Make remote_directory the current directory on
remote machine.

Make it the current directory on the remote machine
the parent directory of the current one.

Changes the access rights of a remote file.

Terminates the FTP session with the remote server and
returns to the shell. All
certain macros are erased.

Toggles deleting a carriage return character when
getting a file in ascii mode. When transferring files to
ascii mode records (lines) end with a pair
carriage return/line feed characters. When cr
enabled (default), carriage returns
removed from this sequence to get
UNIX record delimiter as one
line feed. Entries on non-UNIX remote systems
may contain single newline characters; at
transferring in ascii mode these newlines
can be distinguished from a write delimiter only if
cr is reset.

Deletes the file remote_file from the remote machine.

Prints a listing of the contents of the current directory on
remote machine (or remote_directory), and, if
necessary, places it in local_file. If
interactive prompts enabled, ftp will ask
user check that the last argument
is indeed the local file in which
you need to store the result of dir. If the directory is not
specified, the current directory on the remote is used
car. If no local file is specified, or as
local file specified -, the result is output to
terminal.

Synonym for close.

Sets the file transfer format. Format value
default is file.

Get remote_file and save it to local
car. If no local filename is specified, it
gets the same name as on the remote machine, given
changes caused by current case settings,
ntrans and nmap.
File transfer uses current values
type, format, mode and structure.

Switch filename extension for commands
mdelete,
mget and mput.
If the extension (“globalization” – globbing)
off with glob, filename arguments
are used literally and do not expand. Extension
filenames for mput is done in the same way as in
sh

. For
mdelete and mget, each remote filename is expanded
separately on a remote machine and the lists are not merged into
one. Most likely, the directory name will expand in a different way,
as the name of a regular file: the specific result depends on
remote operating system and ftp server; it can
view by executing the command ‘mls remote_files -‘.
Note that mget and mput are not meant to be forwarded
whole trees of subdirectories of files. It can be done,
by forwarding the tar

archive of the subtree (in binary mode).

Toggles output of “#” sign for each transmitted
data block. The data block size is BUFSIZ bytes.
BUFSIZ is defined in the stdio.h file.

Gives a short (one-line) description of the command. If
no argument given, ftp prints a list of known commands.

Gets/sets the timeout on the remote
car.

Same as binary.

Changes the current directory on the local machine. If
no directory specified, start directory used
user.

Gives an abbreviated listing of the contents of a directory on
remote machine. The listing includes any system-
dependent information that the server has decided to include;
for example, most UNIX systems will issue
the result of the ls -l command (see also nlist). If
remote_dir is not specified, the current one is used
catalog. If interactive prompting is enabled,
ftp will ask the user to verify that the last
the argument is indeed a local
the file to which you want to write the result. If
local file not specified or as
local_file specified -, the result is sent to
terminal. Additional options can be specified by taking
arguments in quotes. For example, ls “-rt dir”, will result in
show listing of directory dir sorted by time
last modified files, if deleted
operating system – UNIX.

Defines a macro. Subsequent lines are remembered as
macro macro_name; empty string (consecutive
newlines in the file or newlines,
entered from the terminal) terminates the macro input mode.
There is a limit – no more than 16 macros and 4096
characters in total in all defined macros.
The macro remains defined until it is executed.
close command. The macro processor interprets ‘

Deletes the specified files from the remote machine.

mdir remote_files local_file

Acts like dir, except that you can specify
deleted files. If issuance of interactive
prompts, ftp will ask the user to verify that
the last argument is indeed
local file to which you want to write the result
running mdir.

Expands the list of remote_files on the remote machine
and executes the get command for each received such
filename pattern. Learn more about name extensions
files, see the description of the glob command. Resultant
filenames are then processed according to
current case settings,
ntrans and nmap. Files
are transferred to the local current directory, which can be
change directory with lcd command; new local
directories can be created with the command ! mkdir
catalog.

Creates a directory on the remote machine.

mls remote_files local_file

Similar to nlist, but allows multiple names
remote files, and local_file to specify
Necessarily. If issuance of interactive
prompts, ftp will ask the user to verify that
the last argument is indeed
local file to which you want to write the result
executing mls.

Sets the specified file transfer mode. By
By default, the stream mode is used.

Shows the time the file was last modified on
remote machine.

Expand wild cards in the list
local files given as arguments, and
executes the put command for each file in
resulting list. Learn more about name extensions
files, see the description of the glob command. Resultant
filenames will then be processed according to
ntrans and nmap settings.
The mput command does not allow you to set filenames on the remote
car.

Get file if remote_file is newer than
local_file.

Lists the files in a directory on the remote machine.
If remote_dir is not specified, the current one is used.
catalog. If interactive prompting is enabled,
ftp will ask the user to verify that the last
the argument is indeed a local
the file to which the results of the command should be written
nlist. If no local file is specified, or as
local_file specified -, the result is sent to
terminal.

Additional options can be specified by taking arguments in
quotes. For example, nlist “-rt dir” will display
sorted by the time the listing was last modified
contents of the directory dir.

Sets and disables the character translation engine
filenames (filename character translation mechanism). If
no arguments specified, name character translation mechanism
files are disabled. If arguments are given, the characters in
remote file names are translated during execution
mput commands and put commands,
which do not contain the name of the remote file. If arguments are given, the characters in
local file names are translated during execution
mget commands and get commands,
which do not include a local file name. This command is useful when
connecting to a remote computer with a non-UNIX operating system,
having different naming conventions or traditions
files. Characters in the filename corresponding to the character
in input_symbols are replaced by the corresponding
character from output_characters. If the character position in
input_characters is greater than the length of output_characters,
character is removed from the filename.

Establishes a connection to the FTP server on the specified
host. You can additionally set the port number in this
In this case, ftp will try to contact the FTP server on this
port. If the auto-registration option is enabled
(default), ftp will also try automatically
register the user on the FTP server (see below).

Toggles interactive prompts
(interactive prompting). Issuing interactive invitations
happens when transferring multiple files to give
the ability for the user to selectively receive or
write files. If the issuance of interactive
prompts is disabled (it is enabled by default),
any mget command
or mput will transfer all files,
and any mdelete command will delete all files.

Execute an ftp command on the second host
connection. This command allows you to execute
simultaneous connection to two remote servers
FTP to transfer files between them. First team
proxy must be an open command to establish a second
control connection. Enter the proxy ? command to
see other ftp commands that can be run by
second control connection. Following commands
work differently if they are preceded by a command
proxy: open
will not define new macros during
automatic registration process, there will be no close
erase existing macro definitions,
get and mget
transfer files from the main manager host
connection to the host of the second control connection, and
put, mput and
append transfer files from host second
control connection to the master control host
connections. Transferring files to third parties is subject to
support for the PASV command of the ftp protocol by the server, to
to which the second control connection is made.

Writes local_file to the remote machine. If
remote_file not specified, for remote file
the name of the local file is used after processing in
according to ntrans settings
or nmap. When transferring
files, the current settings for the type, format,
mode and structure.

Prints the name of the current directory on the remote machine.

Synonym for bye.

quote arg1 arg2 . . .

Specified arguments are sent unchanged
remote FTP server.

Synonym for get.

Gets the file starting from the end of local_file.

Re-transfers the file with the specified number of bytes
positions.

Requests help from a remote FTP server. If
command_name is specified, it is also passed to the server.

When called without arguments, shows the status of the remote
cars. If filename is specified, shows the status of the file
with the corresponding name on the remote machine.

Renames the file old_name on the remote machine to
file new_name.

Clears the response queue. This command is re
synchronizes the command/response sequence with
remote ftp server. Resynchronization can
needed after violation of ftp protocol by remote
server.

Deletes a directory on a remote machine.

Enables and disables saving files with unique
names on the local system. If the file already exists,
whose name is the same as the name of the target local
file for the get command, or
mget, .1 is added to the name.
If the resulting name matches the name
another existing file, to the original name
.2 is added. If this process reaches .99, it issues
error message and no transfer occurs.
The generated unique filename is reported
user. Please note that runique will not affect
local files generated from command
shell interpreter (see below). Default save
with unique names disabled.

Synonym for put.

Enables and disables the use of PORT commands. By
by default, ftp will try to use the PORT command
when establishing a connection for each data transfer.
The use of PORT commands can prevent
delays when performing multiple file transfers. If
PORT command fails, ftp will use
standard data port. When using commands
PORT disabled, attempts to use PORT commands to
every data transfer will not be attempted. This
may be useful for some FTP implementations,
which ignore PORT commands, but erroneously
show that they are accepted.

Returns the size of file filename on the remote machine.

Shows the current ftp status.

Get/set site specific information
on the remote machine.

Sets the file transfer structure to the specified
structure_name. The default is streaming.
structure (stream).

Enables and disables saving files with unique
names on the remote machine. For successful completion
the remote FTP server must support the command
FTP STOU. The remote server will inform
user about the constructed unique name. By
By default, saving files with unique names to
remote machine is disabled.

Shows the type of operating system on the remote
car.

Sets the desired file transfer type for
work with TENEX machines.

Enable or disable packet tracing.

Sets the specified file transfer type (mode).
If no type is specified, the current type is printed. Default
ASCII mode is used.

Sets the file creation mode mask on the remote
car. If the mask is not specified, the current
mask value.

Identifies the user for the remote FTP server.
If no password is specified and the server requires one, ftp will prompt
user to enter a password (after disabling the local
echo). If the account field is not specified and the FTP server
requires it, the user will be prompted to enter
corresponding value. If the account field
specified, the account command will be passed to the remote
server after completion of the registration sequence,
if the remote server does not require an account
for registration. If ftp is not invoked with disable
automatic registration, this process is performed
automatically when you first connect to the FTP server.

Turns the informing mode on and off (verbose
mode). In inform mode, all responses from the FTP server
are shown to the user. Moreover, if the mode
informing is turned on, after the transfer is completed
file is given statistical information about the speed
transmission. By default, informing mode is enabled.

Stop file transfer

Pressing the terminal interrupt key(s) will
ignored when the ftp program has done the necessary
processing locally and waiting for a response from the remote server.
A long delay in this mode can be
the result of processing the ABORT command described above, or
unintended behavior of the remote server, including
ftp protocol violations. If the delay is due to
unintended behavior of the remote server, local
the ftp program will have to be stopped manually.

File naming conventions

Files specified as arguments to ftp commands,
processed according to the following rules.

File transfer options

FTP defines many options that can affect
file transfer. Supported modes (types) ascii, image
(binary), ebcdic and local byte size. ftp command support
ascii file transfer modes
and image, as well as local byte size 8
for tenex transmission mode.

The ftp command only supports standard values ​​for
other file transfer parameters: mode (mode), form
(form) and structures (struct).

File. netrc

The .netrc file contains registration and initialization information,
used by the automatic registration process. He
located in the user’s home directory. Recognized
the following constructions, which may be separated by spaces,
tab characters or newlines:

Specifies the name of the remote machine. Process
auto-registration looks in the .netrc file
the machine construct corresponding to the remote machine,
specified on the ftp command line or as an argument
open commands. If a match is found, they are processed
subsequent .netrc constructs up to the end of the file
or until the next machine.

Specifies the user on the remote machine. If this
design specified, automatic registration process
will start registration using the specified name.

Sets the password. If this construct is specified, the process
automatic registration will pass the specified string,
if the remote server during the registration process
will require a password. Please note that if this design
specified in the .netrc file, ftp will terminate the process automatically
logging in case .netrc can be read
by anyone other than the user (owner).

Sets an optional account password. If
specified this design, the process of automatic
registration will pass the specified string if remote
the server will require an additional account password,
otherwise, the auto-registration process initiates
ACCT command.

Defines a macro. This construct acts as a command
ftp macdef. Macro defined
with the specified name; his
the content starts with the following line in .netrc and
continues to an empty line (two consecutive
newline characters). If a macro named
init, it is automatically executed as the last step
automatic registration process.

Warnings

The correct execution of many commands depends on the correct
behavior of the remote server.

Error handling carriage returns in transfer code
in ascii mode
was fixed in 4.2BSD. This fix may result in
incorrect transfers of binary files to and from 4.2BSD servers in
ascii mode. To avoid this problem, use the mode
file transfer binary.

LINKS

FTP is a rather unusual procedure, as it maintains two logical connections between computers (Fig. 4.5.4.1). One connection is for remote access and uses the Telnet protocol. The other link is for data exchange. The server performs a passive open operation on port 21 and waits for a connection from the client. The client performs an active open operation on port 21. The link remains active until the FTP procedure completes. T OS (IP Service Type)
corresponds to the minimum delay, since this channel is used for manual command entry. A data channel (TCP) is formed every time to transfer files. The channel is opened before the start of the transfer and is closed by the code end_of_file (end of file). I P-type of service (TOS) in this case is focused on maximum throughput.

The end user interacts with the protocol interpreter, whose task is to manage the exchange of information between the user and the file system, both local and remote. The scheme of interaction of various parts of the Internet during the operation of FTP is shown in fig. 4.5.4.1.

First, at the request of the client, a control channel is formed, which is then used to transmit commands from the client and responses from the server. The information channel is formed by the server at the command of the client; it should not exist constantly throughout the entire FTP session and can be formed and liquidated as needed. The control channel can be closed only after the completion of the information exchange. For channel
management uses the Telnet protocol. After the control channel
formed, the client can send commands to it. The server accepts, interprets these commands and sends responses.

Fig. 4.5.4.1 Scheme of the ftp protocol.

Another scheme of interaction is also possible, when, at the initiative of the client, a file exchange is carried out between two computers, neither of which is the client’s machine (see Fig. 4.5.4.2).

Fig. 4.5.4.2. Organization of information exchange between two remote machines

The following options are available during the exchange mode setting phase:

The Stream command sets the mode in which no block control information is sent. This is the fastest exchange mode and works by default.

The TYPE command can set the exchange modes to IMAGE, ASCII, or EBCDIC. Of these, ASCII is the default. The EBCDIC mode is used for exchanges between computers operating with the EBCDIC character set. The IMAGE mode involves the exchange of 8-bit bytes and is used to transfer binary (rather than text) information. A more detailed list of commands is below. Structurally
information can be transferred as files (the default structure), as a sequence of records (applicable for ASCII or EBCDIC text files), or page by page (the latter structure is not recommended).

To copy a file from a remote server, use the GET command, to copy a group of files – MGET, in the latter case wildcards are used, for example, MGET *.txt (or RFC-18*.txt, this will copy files with RFC- 1800.txt to RFC-1899.txt, if any exist in the current directory). To some extent, the GET command is analogous to the DIR (ls) command, only it transfers the contents of the directory, which is equivalent for some operating systems. When using the mget modification, display
caution – you can block the telecommunications channel for a long time
copying. The PUT command is used to write a file to a remote server.
During exchange operations, the current directory of the local computer is usually used. In your
It is always possible to change the local directory using the LCD command or its equivalent. Any exchange command is executed in several stages:

Consider an example of an FTP session. To do this, issue the command (texts typed from the keyboard are in italics):

Any unambiguous abbreviation for a command may be used.

Available commands are:

To quit FTP, use the quit command. In the above example, file exchange was not performed, but the HELP command also requires the transfer of information (as well as dir), since you are given a list of commands available on the remote server. From the list of commands reproduced, the most dangerous is mdelete, as it can erase an entire directory. Non-text files (archived,
graphic and software) should be sent in binary mode. To switch to this mode, the command of the same name is used. To move from one directory to another on a remote server, use the cd directory_name command, and to return to the previous one, cd . . For example cd /pub/msdos.

A link to an object accessible via anonymous FTP is usually written as:

Internet-cmc (CMC – computer-mediated communication) is a computer-to-computer exchange over the Internet.

The following command options (modifiers) are allowed:

The following commands are available within the FTP procedure (the above list of commands is not complete):

In the depositories you can find the following types of files (all types of files listed below are sent in binary mode, not ASCII):

When performing FTP, the system returns three-digit decimal response codes, which allow you to judge the correctness of the exchange and diagnose the procedure. The issuance of the code is accompanied by a comment text. The first digit can take values ​​from 1 to 5. The structure of the codes is shown in Table 4.5.4.3:

Table 4.5.4.3. Diagnostic codes

The value of the code “y” in the above table can take values ​​from 0 to 5. The values ​​of the codes “y” are shown below:

Further in the text, the expression “anonymous FTP” occurs, which implies the following procedure (see also RFC-1635):

Table 4.5.4.4. Response Codes

Versions of FTP have been developed to work with IPv6 (RFC-2428).

BSD mandoc
Linux NetKit (0.17)

NAME

ftp

– Internet

file transfer program

And How
Special symbols. Symbol ‘

Deletes the specified files from the remote machine.

mdir remote_files local_file

Acts like dir, except that you can specify
deleted files. If issuance of interactive
prompts, ftp will ask the user to verify that
the last argument is indeed
local file to which you want to write the result
execute mdir.

Expands the list of remote_files on the remote machine
and executes the get command for each received such
filename pattern. Learn more about name extensions
files, see the description of the glob command. Resultant
filenames are then processed according to
current case settings,
ntrans and nmap. Files
are transferred to the local current directory, which can be
change directory with lcd command; new local
directories can be created with the command ! mkdir
directory.

Creates a directory on the remote machine.

mls remote_files local_file

Similar to nlist, but allows multiple names
remote files, and local_file to specify
Necessarily. If issuance of interactive
prompts, ftp will ask the user to verify that
the last argument is indeed
local file to which you want to write the result
run mls.

Sets the specified file transfer mode. By
the default mode is stream (streaming).

Shows the time the file was last modified on
remote machine.

Expand wild cards in the list
local files given as arguments, and
executes the put command for each file in
resulting list. Learn more about name extensions
files, see the description of the glob command. Resultant
filenames will then be processed according to
ntrans and nmap settings.
The mput command does not allow you to set filenames on the remote
car.

Gets the file if remote_file is newer than
local_file.

Produces a list of files in a directory on the remote machine.
If remote_dir is not specified, the current one is used.
catalog. If interactive prompting is enabled,
ftp will ask the user to verify that the last
the argument is indeed a local
the file to which the results of the command should be written
nlist. If no local file is specified, or as
local_file specified -, the result is sent to
terminal.

Additional options can be specified by taking arguments in
quotes. For example, nlist “-rt dir” will display
sorted by the time the listing was last modified
contents of dir.

Sets and disables the character translation engine
filenames (filename character translation mechanism). If
no arguments specified, name character translation mechanism
files are disabled. If arguments are given, the characters in
remote file names are translated during execution
mput commands and put commands,
which do not contain the name of the remote file. If arguments are given, the characters in
local file names are translated during execution
mget commands and get commands,
which do not include a local file name. This command is useful when
connecting to a remote computer with a non-UNIX operating system,
having different naming conventions or traditions
files. Characters in the filename corresponding to the character
in input_symbols are replaced by the corresponding
character from output_characters. If the character position in
input_characters is greater than the length of output_characters,
the character is removed from the filename.

Establishes a connection to an FTP server on the specified
host. You can additionally set the port number in this
In this case, ftp will try to contact the FTP server on this
port. If the auto-registration option is enabled
(default), ftp will also try automatically
register a user on the FTP server (see below).

Toggles interactive prompts
(interactive prompting). Issuing interactive invitations
happens when transferring multiple files to give
the ability for the user to selectively receive or
write files. If the issuance of interactive
prompts is disabled (it is enabled by default),
any mget command
or mput will transfer all files,
and any mdelete command will delete all files.

Runs an ftp command on the second host
connection. This command allows you to execute
simultaneous connection to two remote servers
FTP to transfer files between them. First team
proxy must be an open command to establish a second
control connection. Enter the proxy ? command to
see other ftp commands that can be run by
second control connection. Following commands
work differently if they are preceded by a command
proxy: open
will not define new macros during
automatic registration process, there will be no close
erase existing macro definitions,
get and mget
transfer files from the main manager host
connection to the host of the second control connection, and
put, mput and
append transfer files from host second
control connection to the master control host
connections. Transferring files to third parties is subject to
support for the PASV command of the ftp protocol by the server, to
to which the second control connection is made.

Writes a local_file to a remote machine. If
remote_file not specified, for remote file
the name of the local file is used after processing in
according to ntrans settings
or nmap. When transferring
files, the current settings for the type, format,
mode and structure.

Prints the name of the current directory on the remote machine.

Synonym for bye.

quote arg1 arg2 . . .

The specified arguments are sent unchanged
remote FTP server.

Synonym for get.

Gets the file starting at the end of local_file.

Repeats the file transfer with the specified number of bytes
positions.

Requests help from a remote FTP server. If
command_name is specified, it is also passed to the server.

When called with no arguments, shows the status of the remote
cars. If filename is specified, shows the status of the file
with the corresponding name on the remote machine.

Renames the file old_name on the remote machine to
file new_name.

Clears the response queue. This command is re
synchronizes the command/response sequence with
remote ftp server. Resynchronization can
needed after violation of ftp protocol by remote
server.

Deletes a directory on the remote machine.

Enables and disables saving files with unique
names on the local system. If the file already exists,
whose name is the same as the name of the target local
file for the get command, or
mget, .1 is added to the name.
If the resulting name matches the name
another existing file, to the original name
.2 is added. If this process reaches .99, it issues
error message and no transfer occurs.
The generated unique filename is reported
user. Please note that runique will not affect
local files generated from command
shell interpreter (see below). Default save
with unique names disabled.

Synonym for put.

Enables and disables the use of PORT commands. By
by default, ftp will try to use the PORT command
when establishing a connection for each data transfer.
The use of PORT commands can prevent
delays when performing multiple file transfers. If
PORT command fails, ftp will use
standard data port. When using commands
PORT disabled, attempts to use PORT commands to
every data transfer will not be attempted. This
may be useful for some FTP implementations,
which ignore PORT commands, but erroneously
show that they are accepted.

Returns the size of file filename on the remote machine.

Shows the current ftp status.

Gets/sets site specific information
on a remote machine.

Sets the file transfer structure to the specified
structure_name. The default is streaming.
structure (stream).

Enables and disables saving files with unique
names on the remote machine. For successful completion
the remote FTP server must support the command
FTP STOU. The remote server will inform
user about the constructed unique name. By
By default, saving files with unique names to
remote machine is disabled.

Shows the type of operating system on the remote
car.

Sets the required file transfer type for
working with TENEX machines.

Enables and disables packet tracing.

Sets the specified file transfer type (mode).
If no type is specified, the current type is printed. Default
ASCII mode is used.

Sets the file creation mode mask on the remote
car. If the mask is not specified, the current
mask value.

Identifies the user for the remote FTP server.
If no password is specified and the server requires one, ftp will prompt
user to enter a password (after disabling the local
echo). If the account field is not specified and the FTP server
requires it, the user will be prompted to enter
corresponding value. If the account field
specified, the account command will be passed to the remote
server after completion of the registration sequence,
if the remote server does not require an account
for registration. If ftp is not invoked with disable
automatic registration, this process is performed
automatically when you first connect to the FTP server.

Enables and disables verbose mode (verbose
mode). In inform mode, all responses from the FTP server
are shown to the user. Moreover, if the mode
informing is turned on, after the transfer is completed
file is given statistical information about the speed
transmission. By default, informing mode is enabled.

Stop file transfer

Pressing the terminal interrupt key(s) will
ignored when the ftp program has done the necessary
processing locally and waiting for a response from the remote server.
A long delay in this mode can be
the result of processing the ABORT command described above, or
unintended behavior of the remote server, including
ftp protocol violations. If the delay is due to
unintended behavior of the remote server, local
the ftp program will have to be stopped manually.

File naming conventions

Files specified as arguments to ftp commands,
processed according to the following rules.

File transfer options

FTP defines many options that can affect
file transfer. Supported modes (types) ascii, image
(binary), ebcdic and local byte size. ftp command support
ascii file transfer modes
and image, as well as local byte size 8
for tenex transfer mode.

The ftp command only supports standard values ​​for
other file transfer parameters: mode (mode), form
(form) and structures (struct).

File. netrc

The .netrc file contains registration and initialization information,
used by the automatic registration process. He
located in the user’s home directory. Recognized
the following constructions, which may be separated by spaces,
tab characters or newlines:

Specifies the name of the remote machine. Process
auto-registration looks in the .netrc file
the machine construct corresponding to the remote machine,
specified on the ftp command line or as an argument
open commands. If a match is found, they are processed
subsequent .netrc constructs up to the end of the file
or until the next machine.

Identifies a user on a remote machine. If this
design specified, automatic registration process
will start registration using the specified name.

Sets a password. If this construct is specified, the process
automatic registration will pass the specified string,
if the remote server during the registration process
will require a password. Please note that if this design
specified in the .netrc file, ftp will terminate the process automatically
logging in case .netrc can be read
by anyone other than the user (owner).

Specifies an optional account password. If
specified this design, the process of automatic
registration will pass the specified string if remote
the server will require an additional account password,
otherwise, the auto-registration process initiates
command ACCT.

Defines a macro. This construct acts as a command
ftp macdef. Macro defined
with the specified name; his
the content starts with the following line in .netrc and
continues to an empty line (two consecutive
newline characters). If a macro named
init, it is automatically executed as the last step
automatic registration process.

Warnings

The correct execution of many commands depends on the correct
remote server behavior.

Error handling carriage returns in transfer code
in ascii mode
was fixed in 4.2BSD. This fix may result in
incorrect transfers of binary files to and from 4.2BSD servers in
ascii mode. To avoid this problem, use the mode
file transfer binary.

LINKS

FTP is a rather unusual procedure, as it maintains two logical connections between computers (Figure 4.5.4.1). One connection is for remote access and uses the Telnet protocol. The other link is for data exchange. The server performs a passive open operation on port 21 and waits for a connection from the client. The client performs an active open operation on port 21. The link remains active until the FTP procedure completes. T OS (IP Service Type)
corresponds to the minimum delay, since this channel is used for manual command entry. A data channel (TCP) is formed every time to transfer files. The channel is opened before the start of the transfer and is closed by the code end_of_file (end of file). I P-type of service (TOS) in this case is focused on maximum throughput.

The end user interacts with a protocol interpreter that manages the exchange of information between the user and the file system, both local and remote. The scheme of interaction of various parts of the Internet during the operation of FTP is shown in fig. 4.5.4.1.

First, at the request of the client, a control channel is formed, which is then used to transmit commands from the client and responses from the server. The information channel is formed by the server at the command of the client; it should not exist constantly throughout the entire FTP session and can be formed and liquidated as needed. The control channel can be closed only after the completion of the information exchange. For channel
management uses the Telnet protocol. After the control channel
formed, the client can send commands to it. The server accepts, interprets these commands and sends responses.

Fig. 4.5.4.1 How the ftp protocol works.

Another interaction scheme is also possible, when, at the initiative of the client, a file exchange is carried out between two computers, neither of which is the client’s machine (see Fig. 4.5.4.2).

Fig. 4.5.4.2. Organization of information exchange between two remote machines

The following options are available during the swap mode setting phase:

The Stream command sets the mode in which no block control information is sent. This is the fastest sharing mode and works by default.

The TYPE command can specify IMAGE, ASCII, or EBCDIC exchange modes. Of these, ASCII is the default. The EBCDIC mode is used for exchanges between computers operating with the EBCDIC character set. The IMAGE mode involves the exchange of 8-bit bytes and is used to transfer binary (rather than text) information. A more detailed list of commands is below. structural
information can be transferred as files (the default structure), as a sequence of records (applicable for ASCII or EBCDIC text files), or page by page (the last structure is not recommended).

To copy a file from a remote server, use the GET command, to copy a group of files – MGET, in the latter case, placeholder characters are used, for example, MGET *.txt (or RFC-18*.txt, this will copy files from RFC-1800 .txt prior to RFC-1899.txt, if any exist in the current directory). To some extent, the GET command is analogous to the DIR (ls) command, only it transfers the contents of the directory, which is equivalent for some operating systems. When using the mget modification, display
caution – you can block the telecommunications channel for a long time
copying. The PUT command is used to write a file to a remote server.
During exchange operations, the current directory of the local computer is usually used. In your
It is always possible to change the local directory using the LCD command or its equivalent. Any exchange command is performed in several stages:

Let’s consider an example of an FTP session. To do this, issue the command (texts typed from the keyboard are in italics):

Any unambiguous abbreviation for a command may be used.

Available commands are:

You can quit FTP with the quit command. In the above example, file exchange was not performed, but the HELP command also requires the transfer of information (as well as dir), since you are given a list of commands available on the remote server. From the list of commands reproduced, the most dangerous is mdelete, as it can erase an entire directory. Non-text files (archived,
graphic and software) should be sent in binary mode. To switch to this mode, the command of the same name is used. To move from one directory to another on a remote server, use the cd directory_name command, and to return to the previous one, cd . . For example, cd /pub/msdos.

A link to an object accessible via anonymous FTP is usually written as:

Internet-cmc (CMC – computer-mediated communication) is computer-to-computer communication over the Internet.

The following command options (modifiers) are allowed:

The following commands are available within the FTP procedure (this list of commands is not exhaustive):

The following types of files can be found in depositories (all types of files listed below are sent in binary mode, not ASCII):

When performing FTP, the system returns three-digit decimal response codes that allow you to judge the correctness of the exchange and diagnose the procedure. The issuance of the code is accompanied by a comment text. The first digit can take values ​​from 1 to 5. The structure of the codes is shown in Table 4.5.4.3:

Table 4.5.4.3. Diagnostic codes

The value of the code “y” in the above table can take values ​​from 0 to 5. The values ​​of the codes “y” are given below:

Further in the text, the expression “anonymous FTP” occurs, which implies the following procedure (see also RFC-1635):

Table 4.5.4.4. Response Codes

RFC-2428 versions of FTP have been developed to work with IPv6.

BSD mandoc
Linux NetKit (0.17)

NAME

ftp

– Internet

file transfer program

followed by a number
(or digits), is replaced by the corresponding argument
calling a macro on the command line. Symbol ‘

Deletes the specified files from the remote machine.

mdir remote_files local_file

Acts like dir, except that you can specify
deleted files. If issuance of interactive
prompts, ftp will ask the user to verify that
the last argument is indeed
local file to which you want to write the result
execute mdir.

Expands the list of remote_files on the remote machine
and executes the get command for each received such
filename pattern. Learn more about name extensions
files, see the description of the glob command. Resultant
filenames are then processed according to
current case settings,
ntrans and nmap. Files
are transferred to the local current directory, which can be
change directory with lcd command; new local
directories can be created with the command ! mkdir
directory.

Creates a directory on the remote machine.

mls remote_files local_file

Similar to nlist, but allows multiple names
remote files, and local_file to specify
Necessarily. If issuance of interactive
prompts, ftp will ask the user to verify that
the last argument is indeed
local file to which you want to write the result
run mls.

Sets the specified file transfer mode. By
the default mode is stream (streaming).

Shows the time the file was last modified on
remote machine.

Expand wild cards in the list
local files given as arguments, and
executes the put command for each file in
resulting list. Learn more about name extensions
files, see the description of the glob command. Resultant
filenames will then be processed according to
ntrans and nmap settings.
The mput command does not allow you to set filenames on the remote
car.

Gets the file if remote_file is newer than
local_file.

Produces a list of files in a directory on the remote machine.
If remote_dir is not specified, the current one is used.
catalog. If interactive prompting is enabled,
ftp will ask the user to verify that the last
the argument is indeed a local
the file to which the results of the command should be written
nlist. If no local file is specified, or as
local_file specified -, the result is sent to
terminal.

Additional options can be specified by taking arguments in
quotes. For example, nlist “-rt dir” will display
sorted by the time the listing was last modified
contents of dir.

Sets and disables the character translation engine
filenames (filename character translation mechanism). If
no arguments specified, name character translation mechanism
files are disabled. If arguments are given, the characters in
remote file names are translated during execution
mput commands and put commands,
which do not contain the name of the remote file. If arguments are given, the characters in
local file names are translated during execution
mget commands and get commands,
which do not include a local file name. This command is useful when
connecting to a remote computer with a non-UNIX operating system,
having different naming conventions or traditions
files. Characters in the filename corresponding to the character
in input_symbols are replaced by the corresponding
character from output_characters. If the character position in
input_characters is greater than the length of output_characters,
the character is removed from the filename.

Establishes a connection to an FTP server on the specified
host. You can additionally set the port number in this
In this case, ftp will try to contact the FTP server on this
port. If the auto-registration option is enabled
(default), ftp will also try automatically
register a user on the FTP server (see below).

Toggles interactive prompts
(interactive prompting). Issuing interactive invitations
happens when transferring multiple files to give
the ability for the user to selectively receive or
write files. If the issuance of interactive
prompts is disabled (it is enabled by default),
any mget command
or mput will transfer all files,
and any mdelete command will delete all files.

Runs an ftp command on the second host
connection. This command allows you to execute
simultaneous connection to two remote servers
FTP to transfer files between them. First team
proxy must be an open command to establish a second
control connection. Enter the proxy ? command to
see other ftp commands that can be run by
second control connection. Following commands
work differently if they are preceded by a command
proxy: open
will not define new macros during
automatic registration process, there will be no close
erase existing macro definitions,
get and mget
transfer files from the main manager host
connection to the host of the second control connection, and
put, mput and
append transfer files from host second
control connection to the master control host
connections. Transferring files to third parties is subject to
support for the PASV command of the ftp protocol by the server, to
to which the second control connection is made.

Writes a local_file to a remote machine. If
remote_file not specified, for remote file
the name of the local file is used after processing in
according to ntrans settings
or nmap. When transferring
files, the current settings for the type, format,
mode and structure.

Prints the name of the current directory on the remote machine.

Synonym for bye.

quote arg1 arg2 . . .

The specified arguments are sent unchanged
remote FTP server.

Synonym for get.

Gets the file starting at the end of local_file.

Repeats the file transfer with the specified number of bytes
positions.

Requests help from a remote FTP server. If
command_name is specified, it is also passed to the server.

When called with no arguments, shows the status of the remote
cars. If filename is specified, shows the status of the file
with the corresponding name on the remote machine.

Renames the file old_name on the remote machine to
file new_name.

Clears the response queue. This command is re
synchronizes the command/response sequence with
remote ftp server. Resynchronization can
needed after violation of ftp protocol by remote
server.

Deletes a directory on the remote machine.

Enables and disables saving files with unique
names on the local system. If the file already exists,
whose name is the same as the name of the target local
file for the get command, or
mget, .1 is added to the name.
If the resulting name matches the name
another existing file, to the original name
.2 is added. If this process reaches .99, it issues
error message and no transfer occurs.
The generated unique filename is reported
user. Please note that runique will not affect
local files generated from command
shell interpreter (see below). Default save
with unique names disabled.

Synonym for put.

Enables and disables the use of PORT commands. By
by default, ftp will try to use the PORT command
when establishing a connection for each data transfer.
The use of PORT commands can prevent
delays when performing multiple file transfers. If
PORT command fails, ftp will use
standard data port. When using commands
PORT disabled, attempts to use PORT commands to
every data transfer will not be attempted. This
may be useful for some FTP implementations,
which ignore PORT commands, but erroneously
show that they are accepted.

Returns the size of file filename on the remote machine.

Shows the current ftp status.

Gets/sets site specific information
on a remote machine.

Sets the file transfer structure to the specified
structure_name. The default is streaming.
structure (stream).

Enables and disables saving files with unique
names on the remote machine. For successful completion
the remote FTP server must support the command
FTP STOU. The remote server will inform
user about the constructed unique name. By
By default, saving files with unique names to
remote machine is disabled.

Shows the type of operating system on the remote
car.

Sets the required file transfer type for
working with TENEX machines.

Enables and disables packet tracing.

Sets the specified file transfer type (mode).
If no type is specified, the current type is printed. Default
ASCII mode is used.

Sets the file creation mode mask on the remote
car. If the mask is not specified, the current
mask value.

Identifies the user for the remote FTP server.
If no password is specified and the server requires one, ftp will prompt
user to enter a password (after disabling the local
echo). If the account field is not specified and the FTP server
requires it, the user will be prompted to enter
corresponding value. If the account field
specified, the account command will be passed to the remote
server after completion of the registration sequence,
if the remote server does not require an account
for registration. If ftp is not invoked with disable
automatic registration, this process is performed
automatically when you first connect to the FTP server.

Enables and disables verbose mode (verbose
mode). In inform mode, all responses from the FTP server
are shown to the user. Moreover, if the mode
informing is turned on, after the transfer is completed
file is given statistical information about the speed
transmission. By default, informing mode is enabled.

Stop file transfer

Pressing the terminal interrupt key(s) will
ignored when the ftp program has done the necessary
processing locally and waiting for a response from the remote server.
A long delay in this mode can be
the result of processing the ABORT command described above, or
unintended behavior of the remote server, including
ftp protocol violations. If the delay is due to
unintended behavior of the remote server, local
the ftp program will have to be stopped manually.

File naming conventions

Files specified as arguments to ftp commands,
processed according to the following rules.

File transfer options

FTP defines many options that can affect
file transfer. Supported modes (types) ascii, image
(binary), ebcdic and local byte size. ftp command support
ascii file transfer modes
and image, as well as local byte size 8
for tenex transfer mode.

The ftp command only supports standard values ​​for
other file transfer parameters: mode (mode), form
(form) and structures (struct).

File. netrc

The .netrc file contains registration and initialization information,
used by the automatic registration process. He
located in the user’s home directory. Recognized
the following constructions, which may be separated by spaces,
tab characters or newlines:

Specifies the name of the remote machine. Process
auto-registration looks in the .netrc file
the machine construct corresponding to the remote machine,
specified on the ftp command line or as an argument
open commands. If a match is found, they are processed
subsequent .netrc constructs up to the end of the file
or until the next machine.

Identifies a user on a remote machine. If this
design specified, automatic registration process
will start registration using the specified name.

Sets a password. If this construct is specified, the process
automatic registration will pass the specified string,
if the remote server during the registration process
will require a password. Please note that if this design
specified in the .netrc file, ftp will terminate the process automatically
logging in case .netrc can be read
by anyone other than the user (owner).

Specifies an optional account password. If
specified this design, the process of automatic
registration will pass the specified string if remote
the server will require an additional account password,
otherwise, the auto-registration process initiates
command ACCT.

Defines a macro. This construct acts as a command
ftp macdef. Macro defined
with the specified name; his
the content starts with the following line in .netrc and
continues to an empty line (two consecutive
newline characters). If a macro named
init, it is automatically executed as the last step
automatic registration process.

Warnings

The correct execution of many commands depends on the correct
remote server behavior.

Error handling carriage returns in transfer code
in ascii mode
has been fixed in 4.2BSD. This fix may result in
incorrect transfers of binary files to and from 4.2BSD servers in
ascii mode. To avoid this problem, use the mode
file transfer binary.

LINKS

FTP is a rather unusual procedure, as it maintains two logical connections between computers (Figure 4.5.4.1). One connection is for remote access and uses the Telnet protocol. The other link is for data exchange. The server performs a passive open operation on port 21 and waits for a connection from the client. The client performs an active open operation on port 21. The link remains active until the FTP procedure completes. T OS (IP Service Type)
corresponds to the minimum delay, since this channel is used for manual command entry. A data channel (TCP) is formed every time to transfer files. The channel is opened before the start of the transfer and is closed by the code end_of_file (end of file). I P-type of service (TOS) in this case is focused on maximum throughput.

The end user interacts with a protocol interpreter that manages the exchange of information between the user and the file system, both local and remote. The scheme of interaction of various parts of the Internet during the operation of FTP is shown in fig. 4.5.4.1.

First, at the request of the client, a control channel is formed, which is then used to transmit commands from the client and responses from the server. The information channel is formed by the server at the command of the client; it should not exist constantly throughout the entire FTP session and can be formed and liquidated as needed. The control channel can be closed only after the completion of the information exchange. For channel
management uses the Telnet protocol. After the control channel
formed, the client can send commands to it. The server accepts, interprets these commands and sends responses.

Fig. 4.5.4.1 How the ftp protocol works.

Another interaction scheme is also possible, when, at the initiative of the client, a file exchange is carried out between two computers, neither of which is the client’s machine (see Fig. 4.5.4.2).

Fig. 4.5.4.2. Organization of information exchange between two remote machines

The following options are available during the swap mode setting phase:

The Stream command sets the mode in which no block control information is sent. This is the fastest sharing mode and works by default.

The TYPE command can specify IMAGE, ASCII, or EBCDIC exchange modes. Of these, ASCII is the default. The EBCDIC mode is used for exchanges between computers operating with the EBCDIC character set. The IMAGE mode involves the exchange of 8-bit bytes and is used to transfer binary (rather than text) information. A more detailed list of commands is below. structural
information can be transferred as files (the default structure), as a sequence of records (applicable for ASCII or EBCDIC text files), or page by page (the last structure is not recommended).

To copy a file from a remote server, use the GET command, to copy a group of files – MGET, in the latter case, placeholder characters are used, for example, MGET *.txt (or RFC-18*.txt, this will copy files from RFC-1800 .txt prior to RFC-1899.txt, if any exist in the current directory). To some extent, the GET command is analogous to the DIR (ls) command, only it transfers the contents of the directory, which is equivalent for some operating systems. When using the mget modification, display
caution – you can block the telecommunications channel for a long time
copying. The PUT command is used to write a file to a remote server.
During exchange operations, the current directory of the local computer is usually used. In your
It is always possible to change the local directory using the LCD command or its equivalent. Any exchange command is performed in several stages:

Let’s consider an example of an FTP session. To do this, issue the command (texts typed from the keyboard are in italics):

Any unambiguous abbreviation for a command may be used.

Available commands are:

You can quit FTP with the quit command. In the above example, file exchange was not performed, but the HELP command also requires the transfer of information (as well as dir), since you are given a list of commands available on the remote server. From the list of commands reproduced, the most dangerous is mdelete, as it can erase an entire directory. Non-text files (archived,
graphic and software) should be sent in binary mode. To switch to this mode, the command of the same name is used. To move from one directory to another on a remote server, use the cd directory_name command, and to return to the previous one, cd . . For example, cd /pub/msdos.

A link to an object accessible via anonymous FTP is usually written as:

Internet-cmc (CMC – computer-mediated communication) is computer-to-computer communication over the Internet.

The following command options (modifiers) are allowed:

The following commands are available within the FTP procedure (this list of commands is not exhaustive):

The following types of files can be found in depositories (all types of files listed below are sent in binary mode, not ASCII):

When performing FTP, the system returns three-digit decimal response codes that allow you to judge the correctness of the exchange and diagnose the procedure. The issuance of the code is accompanied by a comment text. The first digit can take values ​​from 1 to 5. The structure of the codes is shown in Table 4.5.4.3:

Table 4.5.4.3. Diagnostic codes

The value of the code “y” in the above table can take values ​​from 0 to 5. The values ​​of the codes “y” are given below:

Further in the text, the expression “anonymous FTP” occurs, which implies the following procedure (see also RFC-1635):

Table 4.5.4.4. Response Codes

RFC-2428 versions of FTP have been developed to work with IPv6.

BSD mandoc
Linux NetKit (0.17)

NAME

ftp

– Internet

file transfer program

, followed by
goes ‘i’, indicates to the macroprocessor that the macro
must be done cyclically. On the first pass ‘$i’
is replaced with the first argument of the macro call in
command line, on the second pass these characters
are replaced by the second argument, and so on. Character ”, for
which any character goes is replaced with that character.
Use ” to prevent special
character processing ‘

Deletes the specified files from the remote machine.

mdir remote_files local_file

Acts like dir, except that you can specify
deleted files. If issuance of interactive
prompts, ftp will ask the user to verify that
the last argument is indeed
local file to which you want to write the result
execute mdir.

Expands the list of remote_files on the remote machine
and executes the get command for each received such
filename pattern. Learn more about name extensions
files, see the description of the glob command. Resultant
filenames are then processed according to
current case settings,
ntrans and nmap. Files
are transferred to the local current directory, which can be
change directory with lcd command; new local
directories can be created with the command ! mkdir
directory.

Creates a directory on the remote machine.

mls remote_files local_file

Similar to nlist, but allows multiple names
remote files, and local_file to specify
Necessarily. If issuance of interactive
prompts, ftp will ask the user to verify that
the last argument is indeed
local file to which you want to write the result
run mls.

Sets the specified file transfer mode. By
the default mode is stream (streaming).

Shows the time the file was last modified on
remote machine.

Expand wild cards in the list
local files given as arguments, and
executes the put command for each file in
resulting list. Learn more about name extensions
files, see the description of the glob command. Resultant
filenames will then be processed according to
ntrans and nmap settings.
The mput command does not allow you to set filenames on the remote
car.

Gets the file if remote_file is newer than
local_file.

Produces a list of files in a directory on the remote machine.
If remote_dir is not specified, the current one is used.
catalog. If interactive prompting is enabled,
ftp will ask the user to verify that the last
the argument is indeed a local
the file to which the results of the command should be written
nlist. If no local file is specified, or as
local_file specified -, the result is sent to
terminal.

Additional options can be specified by taking arguments in
quotes. For example, nlist “-rt dir” will display
sorted by the time the listing was last modified
contents of dir.

Sets and disables the character translation engine
filenames (filename character translation mechanism). If
no arguments specified, name character translation mechanism
files are disabled. If arguments are given, the characters in
remote file names are translated during execution
mput commands and put commands,
which do not contain the name of the remote file. If arguments are given, the characters in
local file names are translated during execution
mget commands and get commands,
which do not include a local file name. This command is useful when
connecting to a remote computer with a non-UNIX operating system,
having different naming conventions or traditions
files. Characters in the filename corresponding to the character
in input_symbols are replaced by the corresponding
character from output_characters. If the character position in
input_characters is greater than the length of output_characters,
the character is removed from the filename.

Establishes a connection to an FTP server on the specified
host. You can additionally set the port number in this
In this case, ftp will try to contact the FTP server on this
port. If the auto-registration option is enabled
(default), ftp will also try automatically
register a user on the FTP server (see below).

Toggles interactive prompts
(interactive prompting). Issuing interactive invitations
happens when transferring multiple files to give
the ability for the user to selectively receive or
write files. If the issuance of interactive
prompts is disabled (it is enabled by default),
any mget command
or mput will transfer all files,
and any mdelete command will delete all files.

Runs an ftp command on the second host
connection. This command allows you to execute
simultaneous connection to two remote servers
FTP to transfer files between them. First team
proxy must be an open command to establish a second
control connection. Enter the proxy ? command to
see other ftp commands that can be run by
second control connection. Following commands
work differently if they are preceded by a command
proxy: open
will not define new macros during
automatic registration process, there will be no close
erase existing macro definitions,
get and mget
transfer files from the main manager host
connection to the host of the second control connection, and
put, mput and
append transfer files from host second
control connection to the master control host
connections. Transferring files to third parties is subject to
support for the PASV command of the ftp protocol by the server, to
to which the second control connection is made.

Writes a local_file to a remote machine. If
remote_file not specified, for remote file
the name of the local file is used after processing in
according to ntrans settings
or nmap. When transferring
files, the current settings for the type, format,
mode and structure.

Prints the name of the current directory on the remote machine.

Synonym for bye.

quote arg1 arg2 . . .

The specified arguments are sent unchanged
remote FTP server.

Synonym for get.

Gets the file starting at the end of local_file.

Repeats the file transfer with the specified number of bytes
positions.

Requests help from a remote FTP server. If
command_name is specified, it is also passed to the server.

When called with no arguments, shows the status of the remote
cars. If filename is specified, shows the status of the file
with the corresponding name on the remote machine.

Renames the file old_name on the remote machine to
file new_name.

Clears the response queue. This command is re
synchronizes the command/response sequence with
remote ftp server. Resynchronization can
needed after violation of ftp protocol by remote
server.

Deletes a directory on the remote machine.

Enables and disables saving files with unique
names on the local system. If the file already exists,
whose name is the same as the name of the target local
file for the get command, or
mget, .1 is added to the name.
If the resulting name matches the name
another existing file, to the original name
.2 is added. If this process reaches .99, it issues
error message and no transfer occurs.
The generated unique filename is reported
user. Please note that runique will not affect
local files generated from command
shell interpreter (see below). Default save
with unique names disabled.

Synonym for put.

Enables and disables the use of PORT commands. By
by default, ftp will try to use the PORT command
when establishing a connection for each data transfer.
The use of PORT commands can prevent
delays when performing multiple file transfers. If
PORT command fails, ftp will use
standard data port. When using commands
PORT disabled, attempts to use PORT commands to
every data transfer will not be attempted. This
may be useful for some FTP implementations,
which ignore PORT commands, but erroneously
show that they are accepted.

Returns the size of file filename on the remote machine.

Shows the current ftp status.

Gets/sets site specific information
on a remote machine.

Sets the file transfer structure to the specified
structure_name. The default is streaming.
structure (stream).

Enables and disables saving files with unique
names on the remote machine. For successful completion
the remote FTP server must support the command
FTP STOU. The remote server will inform
user about the constructed unique name. By
By default, saving files with unique names to
remote machine is disabled.

Shows the type of operating system on the remote
car.

Sets the required file transfer type for
working with TENEX machines.

Enables and disables packet tracing.

Sets the specified file transfer type (mode).
If no type is specified, the current type is printed. Default
ASCII mode is used.

Sets the file creation mode mask on the remote
car. If the mask is not specified, the current
mask value.

Identifies the user for the remote FTP server.
If no password is specified and the server requires one, ftp will prompt
user to enter a password (after disabling the local
echo). If the account field is not specified and the FTP server
requires it, the user will be prompted to enter
corresponding value. If the account field
specified, the account command will be passed to the remote
server after completion of the registration sequence,
if the remote server does not require an account
for registration. If ftp is not invoked with disable
automatic registration, this process is performed
automatically when you first connect to the FTP server.

Enables and disables verbose mode (verbose
mode). In inform mode, all responses from the FTP server
are shown to the user. Moreover, if the mode
informing is turned on, after the transfer is completed
file is given statistical information about the speed
transmission. By default, informing mode is enabled.

Stop file transfer

Pressing the terminal interrupt key(s) will
ignored when the ftp program has done the necessary
processing locally and waiting for a response from the remote server.
A long delay in this mode can be
the result of processing the ABORT command described above, or
unintended behavior of the remote server, including
ftp protocol violations. If the delay is due to
unintended behavior of the remote server, local
the ftp program will have to be stopped manually.

File naming conventions

Files specified as arguments to ftp commands,
processed according to the following rules.

File transfer options

FTP defines many options that can affect
file transfer. Supported modes (types) ascii, image
(binary), ebcdic and local byte size. ftp command support
ascii file transfer modes
and image, as well as local byte size 8
for tenex transfer mode.

The ftp command only supports standard values ​​for
other file transfer parameters: mode (mode), form
(form) and structures (struct).

File. netrc

The .netrc file contains registration and initialization information,
used by the automatic registration process. He
located in the user’s home directory. Recognized
the following constructions, which may be separated by spaces,
tab characters or newlines:

Specifies the name of the remote machine. Process
auto-registration looks in the .netrc file
the machine construct corresponding to the remote machine,
specified on the ftp command line or as an argument
open commands. If a match is found, they are processed
subsequent .netrc constructs up to the end of the file
or until the next machine.

Identifies a user on a remote machine. If this
design specified, automatic registration process
will start registration using the specified name.

Sets a password. If this construct is specified, the process
automatic registration will pass the specified string,
if the remote server during the registration process
will require a password. Please note that if this design
specified in the .netrc file, ftp will terminate the process automatically
logging in case .netrc can be read
by anyone other than the user (owner).

Specifies an optional account password. If
specified this design, the process of automatic
registration will pass the specified string if remote
the server will require an additional account password,
otherwise, the auto-registration process initiates
command ACCT.

Defines a macro. This construct acts as a command
ftp macdef. Macro defined
with the specified name; his
the content starts with the following line in .netrc and
continues to an empty line (two consecutive
newline characters). If a macro named
init, it is automatically executed as the last step
automatic registration process.

Warnings

The correct execution of many commands depends on the correct
remote server behavior.

Error handling carriage returns in transfer code
in ascii mode
has been fixed in 4.2BSD. This fix may result in
incorrect transfers of binary files to and from 4.2BSD servers in
ascii mode. To avoid this problem, use the mode
file transfer binary.

LINKS

FTP is a rather unusual procedure, as it maintains two logical connections between computers (Figure 4.5.4.1). One connection is for remote access and uses the Telnet protocol. The other link is for data exchange. The server performs a passive open operation on port 21 and waits for a connection from the client. The client performs an active open operation on port 21. The link remains active until the FTP procedure completes. T OS (IP Service Type)
corresponds to the minimum delay, since this channel is used for manual command entry. A data channel (TCP) is formed every time to transfer files. The channel is opened before the start of the transfer and is closed by the code end_of_file (end of file). I P-type of service (TOS) in this case is focused on maximum throughput.

The end user interacts with a protocol interpreter that manages the exchange of information between the user and the file system, both local and remote. The scheme of interaction of various parts of the Internet during the operation of FTP is shown in fig. 4.5.4.1.

First, at the request of the client, a control channel is formed, which is then used to transmit commands from the client and responses from the server. The information channel is formed by the server at the command of the client; it should not exist constantly throughout the entire FTP session and can be formed and liquidated as needed. The control channel can be closed only after the completion of the information exchange. For channel
management uses the Telnet protocol. After the control channel
formed, the client can send commands to it. The server accepts, interprets these commands and sends responses.

Fig. 4.5.4.1 How the ftp protocol works.

Another interaction scheme is also possible, when, at the initiative of the client, a file exchange is carried out between two computers, neither of which is the client’s machine (see Fig. 4.5.4.2).

Fig. 4.5.4.2. Organization of information exchange between two remote machines

The following options are available during the swap mode setting phase:

The Stream command sets the mode in which no block control information is sent. This is the fastest sharing mode and works by default.

The TYPE command can specify IMAGE, ASCII, or EBCDIC exchange modes. Of these, ASCII is the default. The EBCDIC mode is used for exchanges between computers operating with the EBCDIC character set. The IMAGE mode involves the exchange of 8-bit bytes and is used to transfer binary (rather than text) information. A more detailed list of commands is below. structural
information can be transferred as files (the default structure), as a sequence of records (applicable for ASCII or EBCDIC text files), or page by page (the last structure is not recommended).

To copy a file from a remote server, use the GET command, to copy a group of files – MGET, in the latter case, placeholder characters are used, for example, MGET *.txt (or RFC-18*.txt, this will copy files from RFC-1800 .txt prior to RFC-1899.txt, if any exist in the current directory). To some extent, the GET command is analogous to the DIR (ls) command, only it transfers the contents of the directory, which is equivalent for some operating systems. When using the mget modification, display
caution – you can block the telecommunications channel for a long time
copying. The PUT command is used to write a file to a remote server.
During exchange operations, the current directory of the local computer is usually used. In your
It is always possible to change the local directory using the LCD command or its equivalent. Any exchange command is performed in several stages:

Let’s consider an example of an FTP session. To do this, issue the command (texts typed from the keyboard are in italics):

Any unambiguous abbreviation for a command may be used.

Available commands are:

You can quit FTP with the quit command. In the above example, file exchange was not performed, but the HELP command also requires the transfer of information (as well as dir), since you are given a list of commands available on the remote server. From the list of commands reproduced, the most dangerous is mdelete, as it can erase an entire directory. Non-text files (archived,
graphic and software) should be sent in binary mode. To switch to this mode, the command of the same name is used. To move from one directory to another on a remote server, use the cd directory_name command, and to return to the previous one, cd . . For example, cd /pub/msdos.

A link to an object accessible via anonymous FTP is usually written as:

Internet-cmc (CMC – computer-mediated communication) is computer-to-computer communication over the Internet.

The following command options (modifiers) are allowed:

The following commands are available within the FTP procedure (this list of commands is not exhaustive):

The following types of files can be found in depositories (all types of files listed below are sent in binary mode, not ASCII):

When performing FTP, the system returns three-digit decimal response codes that allow you to judge the correctness of the exchange and diagnose the procedure. The issuance of the code is accompanied by a comment text. The first digit can take values ​​from 1 to 5. The structure of the codes is shown in Table 4.5.4.3:

Table 4.5.4.3. Diagnostic codes

The value of the code “y” in the above table can take values ​​from 0 to 5. The values ​​of the codes “y” are given below:

Further in the text, the expression “anonymous FTP” occurs, which implies the following procedure (see also RFC-1635):

Table 4.5.4.4. Response Codes

RFC-2428 versions of FTP have been developed to work with IPv6.

BSD mandoc
Linux NetKit (0.17)

NAME

ftp

– Internet

file transfer program

.

Deletes the specified files from the remote machine.

mdir remote_files local_file

Acts like dir, except that you can specify
deleted files. If issuance of interactive
prompts, ftp will ask the user to verify that
the last argument is indeed
local file to which you want to write the result
execute mdir.

Expands the list of remote_files on the remote machine
and executes the get command for each received such
filename pattern. Learn more about name extensions
files, see the description of the glob command. Resultant
filenames are then processed according to
current case settings,
ntrans and nmap. Files
are transferred to the local current directory, which can be
change directory with lcd command; new local
directories can be created with the command ! mkdir
directory.

Creates a directory on the remote machine.

mls remote_files local_file

Similar to nlist, but allows multiple names
remote files, and local_file to specify
Necessarily. If issuance of interactive
prompts, ftp will ask the user to verify that
the last argument is indeed
local file to which you want to write the result
run mls.

Sets the specified file transfer mode. By
the default mode is stream (streaming).

Shows the time the file was last modified on
remote machine.

Expand wild cards in the list
local files given as arguments, and
executes the put command for each file in
resulting list. Learn more about name extensions
files, see the description of the glob command. Resultant
filenames will then be processed according to
ntrans and nmap settings.
The mput command does not allow you to set filenames on the remote
car.

Gets the file if remote_file is newer than
local_file.

Produces a list of files in a directory on the remote machine.
If remote_dir is not specified, the current one is used.
catalog. If interactive prompting is enabled,
ftp will ask the user to verify that the last
the argument is indeed a local
the file to which the results of the command should be written
nlist. If no local file is specified, or as
local_file specified -, the result is sent to
terminal.

Additional options can be specified by taking arguments in
quotes. For example, nlist “-rt dir” will display
sorted by the time the listing was last modified
contents of dir.

Sets and disables the character translation engine
filenames (filename character translation mechanism). If
no arguments specified, name character translation mechanism
files are disabled. If arguments are given, the characters in
remote file names are translated during execution
mput commands and put commands,
which do not contain the name of the remote file. If arguments are given, the characters in
local file names are translated during execution
mget commands and get commands,
which do not include a local file name. This command is useful when
connecting to a remote computer with a non-UNIX operating system,
having different naming conventions or traditions
files. Characters in the filename corresponding to the character
in input_symbols are replaced by the corresponding
character from output_characters. If the character position in
input_characters is greater than the length of output_characters,
the character is removed from the filename.

Establishes a connection to an FTP server on the specified
host. You can additionally set the port number in this
In this case, ftp will try to contact the FTP server on this
port. If the auto-registration option is enabled
(default), ftp will also try automatically
register a user on the FTP server (see below).

Toggles interactive prompts
(interactive prompting). Issuing interactive invitations
happens when transferring multiple files to give
the ability for the user to selectively receive or
write files. If the issuance of interactive
prompts is disabled (it is enabled by default),
any mget command
or mput will transfer all files,
and any mdelete command will delete all files.

Runs an ftp command on the second host
connection. This command allows you to execute
simultaneous connection to two remote servers
FTP to transfer files between them. First team
proxy must be an open command to establish a second
control connection. Enter the proxy ? command to
see other ftp commands that can be run by
second control connection. Following commands
work differently if they are preceded by a command
proxy: open
will not define new macros during
automatic registration process, there will be no close
erase existing macro definitions,
get and mget
transfer files from the main manager host
connection to the host of the second control connection, and
put, mput and
append transfer files from host second
control connection to the master control host
connections. Transferring files to third parties is subject to
support for the PASV command of the ftp protocol by the server, to
to which the second control connection is made.

Writes a local_file to a remote machine. If
remote_file not specified, for remote file
the name of the local file is used after processing in
according to ntrans settings
or nmap. When transferring
files, the current settings for the type, format,
mode and structure.

Prints the name of the current directory on the remote machine.

Synonym for bye.

quote arg1 arg2 . . .

The specified arguments are sent unchanged
remote FTP server.

Synonym for get.

Gets the file starting at the end of local_file.

Repeats the file transfer with the specified number of bytes
positions.

Requests help from a remote FTP server. If
command_name is specified, it is also passed to the server.

When called with no arguments, shows the status of the remote
cars. If filename is specified, shows the status of the file
with the corresponding name on the remote machine.

Renames the file old_name on the remote machine to
file new_name.

Clears the response queue. This command is re
synchronizes the command/response sequence with
remote ftp server. Resynchronization can
needed after violation of ftp protocol by remote
server.

Deletes a directory on the remote machine.

Enables and disables saving files with unique
names on the local system. If the file already exists,
whose name is the same as the name of the target local
file for the get command, or
mget, .1 is added to the name.
If the resulting name matches the name
another existing file, to the original name
.2 is added. If this process reaches .99, it issues
error message and no transfer occurs.
The generated unique filename is reported
user. Please note that runique will not affect
local files generated from command
shell interpreter (see below). Default save
with unique names disabled.

Synonym for put.

Enables and disables the use of PORT commands. By
by default, ftp will try to use the PORT command
when establishing a connection for each data transfer.
The use of PORT commands can prevent
delays when performing multiple file transfers. If
PORT command fails, ftp will use
standard data port. When using commands
PORT disabled, attempts to use PORT commands to
every data transfer will not be attempted. This
may be useful for some FTP implementations,
which ignore PORT commands, but erroneously
show that they are accepted.

Returns the size of file filename on the remote machine.

Shows the current ftp status.

Gets/sets site specific information
on a remote machine.

Sets the file transfer structure to the specified
structure_name. The default is streaming.
structure (stream).

Enables and disables saving files with unique
names on the remote machine. For successful completion
the remote FTP server must support the command
FTP STOU. The remote server will inform
user about the constructed unique name. By
By default, saving files with unique names to
remote machine is disabled.

Shows the type of operating system on the remote
car.

Sets the required file transfer type for
working with TENEX machines.

Enables and disables packet tracing.

Sets the specified file transfer type (mode).
If no type is specified, the current type is printed. Default
ASCII mode is used.

Sets the file creation mode mask on the remote
car. If the mask is not specified, the current
mask value.

Identifies the user for the remote FTP server.
If no password is specified and the server requires one, ftp will prompt
user to enter a password (after disabling the local
echo). If the account field is not specified and the FTP server
requires it, the user will be prompted to enter
corresponding value. If the account field
specified, the account command will be passed to the remote
server after completion of the registration sequence,
if the remote server does not require an account
for registration. If ftp is not invoked with disable
automatic registration, this process is performed
automatically when you first connect to the FTP server.

Enables and disables verbose mode (verbose
mode). In inform mode, all responses from the FTP server
are shown to the user. Moreover, if the mode
informing is turned on, after the transfer is completed
file is given statistical information about the speed
transmission. By default, informing mode is enabled.

Stop file transfer

Pressing the terminal interrupt key(s) will
ignored when the ftp program has done the necessary
processing locally and waiting for a response from the remote server.
A long delay in this mode can be
the result of processing the ABORT command described above, or
unintended behavior of the remote server, including
ftp protocol violations. If the delay is due to
unintended behavior of the remote server, local
the ftp program will have to be stopped manually.

File naming conventions

Files specified as arguments to ftp commands,
processed according to the following rules.

File transfer options

FTP defines many options that can affect
file transfer. Supported modes (types) ascii, image
(binary), ebcdic and local byte size. ftp command support
ascii file transfer modes
and image, as well as local byte size 8
for tenex transfer mode.

The ftp command only supports standard values ​​for
other file transfer parameters: mode (mode), form
(form) and structures (struct).

File. netrc

The .netrc file contains registration and initialization information,
used by the automatic registration process. He
located in the user’s home directory. Recognized
the following constructions, which may be separated by spaces,
tab characters or newlines:

Specifies the name of the remote machine. Process
auto-registration looks in the .netrc file
the machine construct corresponding to the remote machine,
specified on the ftp command line or as an argument
open commands. If a match is found, they are processed
subsequent .netrc constructs up to the end of the file
or until the next machine.

Identifies a user on a remote machine. If this
design specified, automatic registration process
will start registration using the specified name.

Sets a password. If this construct is specified, the process
automatic registration will pass the specified string,
if the remote server during the registration process
will require a password. Please note that if this design
specified in the .netrc file, ftp will terminate the process automatically
logging in case .netrc can be read
by anyone other than the user (owner).

Specifies an optional account password. If
specified this design, the process of automatic
registration will pass the specified string if remote
the server will require an additional account password,
otherwise, the auto-registration process initiates
command ACCT.

Defines a macro. This construct acts as a command
ftp macdef. Macro defined
with the specified name; his
the content starts with the following line in .netrc and
continues to an empty line (two consecutive
newline characters). If a macro named
init, it is automatically executed as the last step
automatic registration process.

Warnings

The correct execution of many commands depends on the correct
remote server behavior.

Error handling carriage returns in transfer code
in ascii mode
has been fixed in 4.2BSD. This fix may result in
incorrect transfers of binary files to and from 4.2BSD servers in
ascii mode. To avoid this problem, use the mode
file transfer binary.

LINKS

FTP is a rather unusual procedure, as it maintains two logical connections between computers (Figure 4.5.4.1). One connection is for remote access and uses the Telnet protocol. The other link is for data exchange. The server performs a passive open operation on port 21 and waits for a connection from the client. The client performs an active open operation on port 21. The link remains active until the FTP procedure completes. T OS (IP Service Type)
corresponds to the minimum delay, since this channel is used for manual command entry. A data channel (TCP) is formed every time to transfer files. The channel is opened before the start of the transfer and is closed by the code end_of_file (end of file). I P-type of service (TOS) in this case is focused on maximum throughput.

The end user interacts with a protocol interpreter that manages the exchange of information between the user and the file system, both local and remote. The scheme of interaction of various parts of the Internet during the operation of FTP is shown in fig. 4.5.4.1.

First, at the request of the client, a control channel is formed, which is then used to transmit commands from the client and responses from the server. The information channel is formed by the server at the command of the client; it should not exist constantly throughout the entire FTP session and can be formed and liquidated as needed. The control channel can be closed only after the completion of the information exchange. For channel
management uses the Telnet protocol. After the control channel
formed, the client can send commands to it. The server accepts, interprets these commands and sends responses.

Fig. 4.5.4.1 How the ftp protocol works.

Another interaction scheme is also possible, when, at the initiative of the client, a file exchange is carried out between two computers, neither of which is the client’s machine (see Fig. 4.5.4.2).

Fig. 4.5.4.2. Organization of information exchange between two remote machines

The following options are available during the swap mode setting phase:

The Stream command sets the mode in which no block control information is sent. This is the fastest sharing mode and works by default.

The TYPE command can specify IMAGE, ASCII, or EBCDIC exchange modes. Of these, ASCII is the default. The EBCDIC mode is used for exchanges between computers operating with the EBCDIC character set. The IMAGE mode involves the exchange of 8-bit bytes and is used to transfer binary (rather than text) information. A more detailed list of commands is below. Structurally
information can be transferred as files (the default structure), as a sequence of records (applicable for ASCII or EBCDIC text files), or page by page (the last structure is not recommended).

To copy a file from a remote server, use the GET command, to copy a group of files – MGET, in the latter case, placeholder characters are used, for example, MGET *.txt (or RFC-18*.txt, this will copy files from RFC-1800 .txt prior to RFC-1899.txt, if any exist in the current directory). To some extent, the GET command is analogous to the DIR (ls) command, only it transfers the contents of the directory, which is equivalent for some operating systems. When using the mget modification, display
caution – you can block the telecommunications channel for a long time
copying. The PUT command is used to write a file to a remote server.
During exchange operations, the current directory of the local computer is usually used. In your
It is always possible to change the local directory using the LCD command or its equivalent. Any exchange command is performed in several stages:

Let’s consider an example of an FTP session. To do this, issue the command (texts typed from the keyboard are in italics):

Any unambiguous abbreviation for a command may be used.

Available commands are:

You can quit FTP with the quit command. In the above example, file exchange was not performed, but the HELP command also requires the transfer of information (as well as dir), since you are given a list of commands available on the remote server. From the list of commands reproduced, the most dangerous is mdelete, as it can erase an entire directory. Non-text files (archived,
graphic and software) should be sent in binary mode. To switch to this mode, the command of the same name is used. To move from one directory to another on a remote server, use the cd directory_name command, and to return to the previous one, cd . . For example, cd /pub/msdos.

A link to an object accessible via anonymous FTP is usually written as:

Internet-cmc (CMC – computer-mediated communication) is computer-to-computer communication over the Internet.

The following command options (modifiers) are allowed:

The following commands are available within the FTP procedure (this list of commands is not exhaustive):

The following types of files can be found in depositories (all types of files listed below are sent in binary mode, not ASCII):

When performing FTP, the system returns three-digit decimal response codes that allow you to judge the correctness of the exchange and diagnose the procedure. The issuance of the code is accompanied by a comment text. The first digit can take values ​​from 1 to 5. The structure of the codes is shown in Table 4.5.4.3:

Table 4.5.4.3. Diagnostic codes

The value of the code “y” in the above table can take values ​​from 0 to 5. The values ​​of the codes “y” are given below:

Further in the text, the expression “anonymous FTP” occurs, which implies the following procedure (see also RFC-1635):

Table 4.5.4.4. Response Codes

RFC-2428 versions of FTP have been developed to work with IPv6.

BSD mandoc
Linux NetKit (0.17)

NAME

ftp

– Internet

file transfer program

:/>  Что можно сделать с ноутбуком ASUS RHG Strix (увеличить объем оперативной памяти и установить дополнительный диск)?

Оставьте комментарий