ftp (software)

from Wikipedia, the free encyclopedia
Screenshot from ftpon a Unix system

ftp is an interactive terminal client available on almost every operating system for the data transfer protocol File Transfer Protocol (FTP). The client, originally programmed for Unix , was soon ported to other operating systems (e.g. Windows NT ).

Usage and functions

The ftp program is usually started with a command line command , often with the specification of an FTP server as an argument to be contacted:

ftp ftp.example.com

When the connection is successful, the program usually asks for a user name and password and, after logging in, it enters the state in which, similar to a shell , it expects commands from the user. These commands are confirmed with the Enter key and then executed. Only after a command has been fully executed does the command line reappear and the user can continue to enter commands.

The client ftp allows the definition of so-called macros, which are used to execute a complex chain of commands with a single command. A macro is created as follows: The user starts recording the macro with the command macdef makroname. Then all lines that the user enters are recorded until they finish the recording with a blank line. The recorded commands are executed as soon as is $makronameentered. A maximum of 16 macros can be defined, which must not contain more than 4096 characters in total.

Commands

The commands are entered in the same way as commands are entered in a terminal . The following commands are available:

![command]
Executes a shell command or changes to the shell (without [command] ).
?
Equivalent to help .
account
Sends the account command to the server.
append [local_file] [remote_file]
Copies the contents of a local file [local_file] to the end of the file [remote_file] on the server.
ascii
Set ASCII as the transmission mode. This is the default transfer mode. Files that are transferred in this mode are converted between the different line break variants of the operating systems involved in the transfer . This mode is only useful if two operating systems with different line break encodings act as servers or clients.
bell
Switches the acoustic signal on / off after the command has been executed.
binary
Setting binary as the transfer mode. The standard transmission mode is ASCII . You should switch to this mode for binary files so that accidentally random byte combinations , which represent the line break bytes to be converted, are not changed and, in the worst case, the binary file is rendered unusable.
bye
Closes the connection to the server and exits the program.
cd [remote_directory]
Changes to the working directory [remote_directory] on the server. See the Unix command of the same name cd
cdup
Changes to the next higher directory level on the server. See the similar Unix commandcd ..
chmod [datei]
Changes the Unix file rights of the file [file] , the syntax corresponds to that of the Unix command chmod.
close
Closes the connection to the server and deletes all macros. The ftp program is not terminated, however, so that you can then establish a new FTP connection with the open command, for example .
delete [remote_file]
Deletes the [remote_file] file on the server.
dir
Displays the contents of the current working directory on the server. Similarly, they use the command of Windows - prompt you . Equivalent to the command ls
disconnect
Equivalent to close .
get [remote_file] ([local_file])
Copies the file [remote_file] from the server to the client and saves it under the name [local_file] . If [local_file] is not given, it will be saved under the original name.
hash
Defines that a pound sign (#) should be output for each data block transferred . This makes sense when transferring large files, as otherwise ftp does not provide any information about the progress of the data transfer.
help ([Kommando])
Outputs information about the client command [command] . If no command is given, a list of all available commands is output. See also remotehelp .
lcd ([local_directory])
Changes to the directory [local_directory] on the client. If no directory is specified, the current user's home directory is switched to. In this way, the functionality is synonymous with the Unix command cd.
ls [remote_directory] ([local_file])
Outputs a short form of the directory [remote_directory] and redirects the output, if given, to the file [local_file] on the client computer. See the Unix command of the same namels
mget [remote_files]
Copies multiple files from the server to the client. Wildcards are allowed. In interactive mode, every file transfer must be confirmed.
mkdir [remote_directory]
Creates the [remote_directory] directory on the server. See the Unix command of the same namemkdir
mput [local_files]
Copies multiple files from the client to the server. Wildcards are allowed. In interactive mode, every file transfer must be confirmed.
open [host] ([port])
Establishes a connection to the FTP server [host] on the TCP port [port] .
passive
Switches the passive FTP mode on or off.
prompt
Switches the interactive mode on / off, which leads to queries with some commands (e.g. mget). The user is asked by default.
put [local_file] ([remote_file])
Copies a file [local_file] to the server and stores it there under the name [remote_file] . If [remote_file] is not given, the original file name is retained.
pwd
Outputs the current working directory on the server. See the Unix command of the same name pwd.
quit
Equivalent to bye .
remotehelp ([Kommando])
Outputs information about the server command [command] . If no command is given, a list of all available commands is output. See also help .
rename [from] [to]
Renames the file on the server [from] to [to] .
rmdir [remote_directory]
Deletes the [remote_directory] directory on the server. As usual on Unix systems, only empty directories can be deleted. Therefore, the client must first go through the directory recursively and delete all files in it.
runique
Prohibits the overwriting of files on the client computer by adding an extension in the form of .Zummer to the file name .
send [local_file] ([remote_file])
Equivalent to put .
status
Outputs status information.
sunique
Like runique only for files on the server.
type ([type])
Definition of the transmission mode (ASCII, IMAGE). If [type] is missing , the currently used transmission mode is output. See the binary and ascii commands above, which perform the same task.
user [username] [password]
Log on to the FTP server with the user name [username] and the password [password] .
verbose
Switches the detailed display mode on / off.

Implementations

There are various implementations for various Unix derivatives as well as for Windows from Windows 95 . For Windows for Workgroups 3.11, FTP and Telnet were included in the subsequent installation of the TCP / IP package.

Web links