I comandi FTP Os comandos FTP Die FTP-Befehle Comandos FTP

The FTP protocol

FTP (File Transfer Protocol) is a protocol — meaning a standard language that lets two machines communicate — used so that computers of different types (or with different operating systems) can transfer files over a network that uses TCP/IP.

FTP operates in a client/server environment, meaning that the remote machine is configured as a server, and consequently waits for the other machine to request a service from it. In UNIX, the service is provided by what is called a daemon, a small task that runs in the background. The FTP daemon is called ftpd.

There are many FTP client programs, some of which are run from a command-line (such as the command ftp, a standard installed in many operating systems), but a large majority allow the user to manipulate files via a graphical interface (such as CuteFTP), which makes file transfers more user-friendly.

The FTP protocol is used for transferring one file at a time, in either direction, between the client machine (the one which initiated the connection, i.e. the calling machine) and the server machine (which provided the FTP service, i.e. the called machine). The FTP protocol can also perform other actions, such as creating and deleting directories (only if they are empty), listing files, deleting and renaming files, etc.

Protocols and implementation

Do not confuse the separate concepts of the protocol and its implementation!
A protocol is a set of rules and procedures which have been defined in order to standardise communications, while the implementation is software programming which follows (more or less) the protocol's recommendations. For this reason, FTP has been implemented across numerous platforms, based on the specifications of the protocol.

Logging in to an FTP server

The command "ftp" is available across various platforms, including UNIX, Windows and Linux. The command initiates an FTP session, and is usually run as follows:

ftp server_name

server_name represents the name or IP address of the remote machine that the user wants to connect to. The target machine must, of course, have an FTP service.

Once the connection has been initialised, a few lines of text appear on the screen. The first line lets you know that you have connected to an FTP server, the next lines welcome you to it, and may indicate which kind of FTP site it is (i.e, what sort of files it hosts or which organisation owns it), or instructions for users.

In FTP, each line begins with a number that represents either success or failure. For a welcome message, the line might be preceded by the number 220, which means "the service is ready for the new user."

The server asks you to enter your user name (also called a login or identification), in order to set access rights (such as read/write privileges). After the user name has been accepted, a line beginning with the number 331 invites you to input your password, which is masked, meaning that it doesn't appear on the screen.

In some cases the server may be public, in which case you can log in anonymously, and you will therefore have to log in as "anonymous" (or "guest"). For public servers, custom dictates that the user enters his/her email address as the password, but you can enter whatever you choose.

Once the password has been accepted, a message will show if connection has been established or not, in which case a reason will be given (for example, the site may have reached its maximum number of users allowed at a time, in which case the message "No more users allowed" appears).

Once logged in, the FTP site waits for the user to enter commands describing actions to perform.

FTP commands

The normal FTP commands are:

Order Description
help Displays all commands supported by the FTP server.
status Used for showing some of the client machine's settings
binary This command switches you from ASCII mode (sending text documents) to binary mode (sending binary files, i.e. non-text files like images or programs)
ascii Switches from binary mode to ASCII mode. This is the default mode.
type Displays the current transfer mode (binary or ASCII)
user Allows you to log in on the current FTP server again using a different user name. You will then be requested to enter a new password.
ls Lists all files found in the current directory. The command "ls -l" gives additional information on the files.
pwd Displays the full name of the current directory
CD The command means change directory, and is used for changing to a different directory. The command "cd .." is used to access the parent directory
mkdir The command mkdir (in UNIX, or md in Microsoft) is used for creating a directory within the current directory. The use of this command is reserved for users with access allowing it.
rmdir The command rmdir (in UNIX, or rmd in Microsoft) is used for deleting a directory within the current directory. The use of this command is reserved for users with access allowing it.
get This command is used to retrieve a file found on the server.
  • If the command is followed by a file name, the remote file will be transferred to the local machine, into the current local directory
  • If the command is followed by two file names, the remote file (the first name) is transferred to the local machine in the current local directory, with the specified file name (the second name)
If the file name contains spaces, be sure to enter it within quote marks.
put This command is used to send a local file to the server
  • If the command is followed by a file name, the local file will be transferred to the remote machine, into the current remote directory
  • If the command is followed by two file names, the local file (the first name) is transferred to the remote machine in the current remote directory, with the specified file name (the second name)
If the file name contains spaces, be sure to enter it within quote marks.
open Logs out and opens a new session on another FTP server
close Logs out, leaving the FTP client active
bye Disconnects the FTP client from the server and puts it into inactive mode
quit Disconnects the FTP client from the server and puts it into inactive mode

More information



Last update on Thursday October 16, 2008 02:43:15 PM.This document entitled « FTP commands » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.
Best answers for « FTP commands » in :
Connecting to a Ftp server under Ms-Dos Show Connecting to a Ftp server under Ms-Dos The ftp command allows you to get connected using command lines. Some of these options provide an automatic connection; this is done through a list of commands store on a text file. ftp -i ...
FTP protocol (File Transfer Protocol) Show Introduction to FTP protocol FTP protocol (File Transfer Protocol) is, as its name indicates a protocol for transferring files. The implementation of FTP dates from 1971 when a file transfer system (described in RFC141) between MIT machines...
Command prompts for Windows ShowCommand prompts for Windows Some of these command below can cause harmful an undesirable functions, leading to the formatting of your hard disk and data loss, while others will not run under Windows XP. As for Windows Vista the Run Tab is not...
Command to detect your IP address! ShowCommand to detect your IP address! Command for Windows 2000 / XP / Vista Command for Windows 95/98 Command for Linux IP address (Internet Protocol) is a numerical identification to detect your computer on a network. It is used to...
Enable/disable a device from the command line ShowEnable/disable a device from the command line Install Devcon Display all the devices in the system Enable/disable the device Other devices Here is a trick that allows you to enable / disable a device from the command line in XP....
Download Free commander ShowFree Commander is an alternative program to replace the file manager or the Windows explorer. The program is easy to use and will help you for your daily tasks. You will find all the necessary functions for the data management. The main...
FTP commands ShowThe FTP protocol FTP (File Transfer Protocol) is a protocol — meaning a standard language that lets two machines communicate — used so that computers of different types (or with different operating systems) can transfer files over a...
FTP commands ShowThe FTP protocol FTP (File Transfer Protocol) is a protocol — meaning a standard language that lets two machines communicate — used so that computers of different types (or with different operating systems) can transfer files over a...
UNIX Commands ShowTable of the main UNIX commands Unix Commands Description Options ls lists the content of a directory -a Displays all files, including hidden files -I Displays a...