Windows.  Viruses.  Notebooks.  Internet.  office.  Utilities.  Drivers

To connect to the FTP server, it is not necessary to use any third-party programs - this can also be done using standard Windows features. To do this, you can use the CMD command line. But in order to manage the server through standard features operating system, you will have to learn the available commands, since CMD does not have a visual interface. In this article, you will learn the basic FTP commands and how to put them into practice.

Why is it better to download the client than use CMD

If the CMD command line allowed you to perform all available operations on FTP servers, then perhaps there would be no need for clients. But the reality is that the CMD line is quite limited in terms of server management. Therefore, it’s still better to find an opportunity and download a utility for managing the server via FTP to your computer. For example, download the FileZilla client program to your PC - you can download it for free from the official website of the developers. It won't take long to install. And to connect to the server, you will only need to enter your login, password and hostname in the required line. It is much more difficult to do this through CMD.

The specific disadvantage of the CMD line is that you won't even be able to go into passive mode while on the server. And without this mode, you will not be able to exchange files with FTP servers that work through NAT.

In fact, this is a very big drawback of CMD. Therefore, come to terms with the fact that the Windows command line is only suitable for manipulations inside file system without data exchange. Although for those who use the FTP server for routine repetitive work, the command line may seem very convenient. But it's better to try both the client and CMD to draw any conclusions.

What are the commands to manage FTP in CMD command line

To get started, launch a command prompt. You can do this by searching in the "Start" - find the cmd.exe file and open it, after which the line will be launched.

To connect to the server, you need to use the OPEN command. After this command, you must enter the IP address or hostname with which you want to connect. After entering this request, you will be able to log in to the server. This can be done using the USER command, which makes an authentication request through the entered login. After you need to enter the PASS command, which means the password. When you enter the password and press "Enter", you will be authorized on the server.

In general, the command line is only suitable for surfing the server, moving files, etc. First you will need to see the files that are on the server. To do this, use the LS command. Since there is no cursor on the command line, you need to select a directory or file using special commands. Use the CD or LCD line for this - the first is needed to change the current object on the remote computer, and the second is for the local one, that is, for your PC.

Although you will not be able to upload your files to the FTP server via CMD, you can download the data to your computer. To do this, use the GET command. First, write the GET command with the name of the file, and then specify which directory on your computer is the current one so that the server transfers the data to that folder.

These commands are the most commonly used. That is, most users manage the server through CMD in order to quickly download files without first installing the client. But you can go much further and use other commands on the server with the CMD line. For example, you can add a command completion signal on the server using the BELL string.

If you want to end your session and log out command line and server, then write BYE. And to terminate the control connection only on the server, so that you remain inside the command line, write CLOSE. In this case, the files that you download to your PC from the server will continue to download and after the download is completed, the session will be completely covered.

With CMD, you can easily manipulate directories on the server. For example, to delete a specified directory, use the DELETE command. And in order for a list of files of a certain folder to appear on the screen, write DIR and the path to the directory. If you want to delete more than one folder or file, but several at once, then use the MDELETE command, that is, multi-delete. Similarly, the "m" prefix can be used for other commands, so that several actions can be combined into one. So, to display a list of files from several directories at once, write MDIR, and use MGET to download a batch of data from the server. But do not confuse the multi-command with a single MKDIR - it is needed in order to generate a directory on the server.

There is a chance that your FTP server is running without NAT technology, so passive client mode is not needed. In this case, you will be able to upload certain files to the host. Use the MPUT command to upload multiple files, and PUT if you only want to send one.

Another popular command that will most likely come in handy for you is RENAME. Need command to rename files. It will be useful for those who use the server as a repository for site data. You will also need the PWD command, which determines the current folder on the remote FTP server, and not on your computer, as the LCD line does.

The above commands are not a complete list of functions that you can use in FTP. There are other teams as well. And you can find out about them right on the command line if you enter the HELP query. After that, a directory will appear with all the available CMD commands that can be used in FTP. Just keep in mind that at this moment you must be connected to the server, otherwise Windows will give you another directory. And if you want to request help from the server itself, then write REMOTEHELP.

Of course, managing a server with commands is a stone age thing. Therefore, it is better not to waste time, download a normal FTP client to your computer and use the server to the maximum, and not partially. But practice in command CMD line hasn't bothered anyone yet!

FTP (File Transfer Protocol) is a popular network protocol, which is used to copy files from one computer to another on a local network or on the Internet. FTP is one of the oldest application protocols, predating HTTP and even TCP/IP in 1971.

The FTP protocol is vulnerable, that is, FTP cannot encrypt its traffic, all transmissions are clear text, so usernames, passwords, commands and data can be read by anyone who can intercept the packet over the network. For secure data transfer, SFTP (Secure File Transfer Protocol) is used. Unlike standard FTP, it encrypts both commands and data, preventing passwords and sensitive information from being transmitted openly across the network. SFTP is similar in functionality to FTP, but because it uses a different protocol, standard FTP clients cannot contact an SFTP server, and vice versa. Next, consider the basic commands for working with the FTP program.

FTP client is included in most Linux distributions. Let's start by running the program and ftp connection and, of course, we will consider the basic commands for downloading from an ftp server and uploading to ftp, creating directories, deleting files, etc. In this article we will describe only the main commands, and at the end of the article we will give a help and a manual from the console - you can always find out about the purpose of the command and its syntax, as well as about all available commands on a particular ftp server.

FTP connection

To start an FTP connection, just enter the command ftp<сервер> For example:

ftp test.hostingthutor.com

After pressing the enter key, the output of the command will be as follows:

Connected to test..55.5.11).
220 test..
Name (test.site:ftpuser):

Another way to connect is to run ftp from the console and then connect to the ftp server using the command open:

ftp
ftp> test.site

In addition, it is possible to connect by ip:

ftp 114.55.5.11

Or with such an address ftp This e-mail address is being protected from spambots. To view it, your browser must have Java-script enabled, that is:

ftp This e-mail address is being protected from spambots. You must have Javascript enabled in your browser to view it.
230 User ftpuser logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

You can see from the message that the binary (binary) transfer type is used for file transfer. Binary file transfer mode is the transfer of files as they are stored on the FTP server. Ascii (text) mode is used to transfer only text files. You can enter commands ascii or binary to switch between transmission modes. Binary mode must be used for all non-text file types - images, archives, programs, etc.

So, let's move on to the commands for navigating and navigating through the directories of the ftp server:

pwd - the command will show the current directory on the ftp server:

ftp>pwd
257 "/" is the current directory

ls - the command will show a list of files and directories in the current directory:

ftp>ls
227 Entering Passive Mode.
150 Opening ASCII mode data connection for file list
-rw-r--r-- 1 ftpuser ftpuser 3034978 Jun 31 19:02 file1.tar.gz
-rw-r--r-- 1 ftpuser ftpuser 30842294 Jul 31 20:08 file2.tar.gz
-rw-r--r-- 1 ftpuser ftpuser 67798316 Jul 31 19:46 file3.tar.gz
-rw-r--r-- 1 ftpuser ftpuser 6001252 Jan 17 12:02 file4.zip
-rw-r--r-- 1 ftpuser ftpuser 31386394 Jan 17 11:28 file5.tar.gz
drwxr-xr-x 2 ftpuser ftpuser 4 Jan 17 20:23 www
-rw-r--r-- 1 ftpuser ftpuser 48546694 Jan 17 11:33 file6.zip
226 Transfer complete

cd<имядиректории> - command to go to the desired directory:

ftp> cd www
250 CWD command successful

We check with the team pwd :

ftp>pwd
257 "/www" is the current directory

mkdir<имя директории> - creating a new directory (catalog):

ftp> mkdir tmp
257 "/tmp" - Directory successfully created

rmdir<имя директории> - deleting a directory (catalog):

ftp>rmdir tmp
250 RMD command successful

Deleting files on ftp server

delete<имяфайла> - deletes a file on a remote ftp server:

ftp>delete test1.sql
250 DELE command successful

Download files from ftp

get - download the file to the local machine. get fileName or get fileName newFileName

ftp> get file.zip
local: file.zip remote: file.zip
227 Entering Passive Mode.

226 Transfer complete
486694 bytes received in 0.229 secs (6.5e+04 Kbytes/sec)

Download file.zip to local machine as file2.zip:

ftp> get file.zip file2.zip
local: file2.zip remote: file.zip
227 Entering Passive Mode .
150 Opening BINARY mode data connection for file.zip (486694 bytes)
226 Transfer complete
486694 bytes received in 0.306 secs (9.4e+04 Kbytes/sec)

With the command get files are copied from the remote ftp server to the current local directory. To change the current local directory, use the command lcd:

lcd<путь> - change the current directory on the local machine:

ftp>lcd /root
Local directory now /root

To download multiple files from remote ftp server to the local machine, you can use the command mget .

ftp> mget *.sql
mget test2.sql? y
227 Entering Passive Mode.
(23957080 bytes)
226 Transfer complete
23957080 bytes received in 0.233 secs (1e+05 Kbytes/sec)
mget test1.sql? y
227 Entering Passive Mode.
(11873185 bytes)
226 Transfer complete
11873185 bytes received in 0.135 secs (8.6e+04 Kbytes/sec)

Download of each file must be confirmed (yes / no) y /n .

Another download option mget :

ftp>mget test1.sql test2.sql
mget test1.sql? y
227 Entering Passive Mode.

226 Transfer complete
11873185 bytes received in 0.101 secs (1.1e+05 Kbytes/sec)
mget test2.sql? y
227 Entering Passive Mode.

226 Transfer complete
23957080 bytes received in 0.204 secs (1.1e+05 Kbytes/sec)

Uploading a file to an ftp server

put<имяфайла> - command to upload one file to ftp server.

ftp> put test1.sql
local: test1.sql remote: test1.sql
227 Entering Passive Mode.
150 Opening BINARY mode data connection for test1.sql
226 Transfer complete
11873185 bytes sent in 0.129 secs (9e+04 Kbytes/sec)

For uploading multiple files you can immediately use the command mput :

ftp> mput test1.sql test2.sql
mput test1.sql? y
227 Entering Passive Mode.
150 Opening BINARY mode data connection for test1.sql
226 Transfer complete
11873185 bytes sent in 0.0964 secs (1.2e+05 Kbytes/sec)
mput test2.sql? y
227 Entering Passive Mode.
150 Opening BINARY mode data connection for test2.sql
226 Transfer complete
23957080 bytes sent in 0.354 secs (6.6e+04 Kbytes/sec)

Each file upload must be confirmed. y / n (Not really).

Another command option mput :

ftp> mput *.sql
mput test1.sql? y
227 Entering Passive Mode.
150 Opening BINARY mode data connection for test1.sql
226 Transfer complete
11873185 bytes sent in 0.0985 secs (1.2e+05 Kbytes/sec)
mput test2.sql? y
227 Entering Passive Mode.
150 Opening BINARY mode data connection for test2.sql
226 Transfer complete
23957080 bytes sent in 0.2 secs (1.2e+05 Kbytes/sec)

If large files are being uploaded to FTP, it would be nice to monitor the progress of the upload. For this you can use the commands hash And tick .

hash - a command after which ftp will print the "#" character every 1024 bytes of data:

ftp>hash
Hash mark printing on (1024 bytes/hash mark).
put file2.tar.gaz
##########################
226 Transfer complete
785888111 bytes sent in 6.94 secs (1.1e+05 Kbytes/sec)

tick - the command will display the byte counter:

ftp>tick
Hash mark printing off.
Tick ​​counter printing on (10240 bytes/tick increment).
ftp> put file2.tar.gz
local: file2.tar.gz remote: file2.tar.gz
227 Entering Passive Mode.
150 Opening BINARY mode data connection for file2.tar.gz
Bytes transferred: 912706618 -> counter
226 Transfer complete
912706618 bytes sent in 8.08 secs (1.1e+05 Kbytes/sec)

That's the whole basic set of commands for working with ftp in the console. To view the list of available commands on a given FTP server, you can use the command help :

ftp>help
Commands may be abbreviated. Commands are:

Debug mdir sendport site
$ dir mget put size
account disconnect mkdir pwd status
append exit mls quit struct
ascii form mode quote system
bell get modtime recv sunique
binary glob mput reget tenex
bye hash newer rstatus tick
case help nmap rhelp trace
cd idle nlist rename type
cdup image ntrans reset user
chmod lcd open restart umask
close ls prompt rmdir verbose
cr macdef passive runique ?
delete mdelete proxy send

Also, you can get a short help for each command. help<команда> :

ftp> help status
status show current status

ftp>help quit
quit terminate ftp session and exit

ftp>help bye
bye terminate ftp session and exit

And finally, the two commands above quit or bye to close ftp session and exit:

ftp>quit
221 Goodbye.

Detailed information with a description of the commands can be obtained using man ftp on the command line.

# man ftp
Formatting page, please wait...
FTP(1) BSD General Commands Manual FTP(1)

NAME
ftp - Internet file transfer program

SYNOPSIS
ftp [-apinegvd]
pftp [-apinegvd]
................
...............

NAME
ftp - file transfer protocol

SYNTAX

Ftp [-v] [-d] [-i] [-n] [-U] [-p] [-g]

DESCRIPTION
The ftp program allows you to transfer files to or receive files from a remote computer, and works with files and directories on a remote computer.

WORK WITH FTP.
To use the ftp program, you need to open a link between your machine and the remote machine where or from where you want to move the file. This program allows you to have multiple links at the same time, although you can issue commands that only affect one link. Multi-machine communication allows you to communicate with multiple machines in a single ftp session. You do not need to re-register on another machine when you want to change the machine for communication. The link used in this moment, is called the current link.

Types of file recording for transfer to ftp.
The ftp program allows you to use two types of notation: ASCII or binary. Use ASCII for text files. Binary is used for binary data, which must be a continuous sequence of bits. ASCII is the default. The binary view can be used for some special files, such as programs, pictures, archives.

ftp call.
To invoke ftp from a UNIX shell, enter the ftp command. When the command is executed, a prompt for that command will appear on your screen. It looks like this:

Ftp> You can specify the name of the machine you want to contact, although this is not required. The following example shows how the machine name ftp.botik.ru is written: $ ftp ftp.botik.ru This is equivalent to using the ftp open command to establish a connection with the machine you named. You can also call ftp without a host name, for example: $ ftp If you didn't set a host name when you called ftp, you must open a link to that host in ftp. This is done using the ftp open command before you start transferring files. For more information on this subject, see the "Description of ftp Commands" section later in this chapter.

ftp options.
Additionally, when calling ftp, you can specify some options for this command. These options are placed after the name of the ftp command, but before the host name, if any. Each option consists of a dash (-) and one letter, for example: -v. Each option has a corresponding command of the same name that can be used inside ftp. You should distinguish between the use of options and the corresponding ftp commands.

-vMakes ftp run in verbose mode. In this mode, ftp messages sent by a remote machine to ftp appear on your display screen. In addition, if you use this mode, after each file transfer is completed, a statistical message about it appears. This mode is set by default if ftp is running interactively. If ftp is running in command mode, verbose mode is disabled, then the -v option turns it on. You can enable this mode inside ftp with the verbose command.
-dMakes ftp run in debug mode. In this mode, ftp messages sent by ftp to a remote machine are displayed on your display screen. If you do not use this option, no information is displayed. You can also invoke this mode in ftp using the debug command.
-nPrevents the use of ftp autoregistration when communicating with a remote machine. When autologin mode is set, ftp will automatically identify you to the remote machine and log you in to that machine. (See "Using the .netrc file for automatic registration" later in this section.) If you use the -n option to disable automatic registration, you will need to use the user command to manually log in to the remote machine.
-gCauses UNIX filenames to be stripped of their extensions, such as the wildcard (*). If you do not use this option, ftp expands filenames with a generic extension in the file list. You can use the glob command instead of this option.
The following are examples of using ftp options: $ ftp -v -d ftp.botik.ru The above command invokes ftp in verbose and debug mode and causes ftp to open a connection to a remote machine called ftp.botik.ru. In debug mode, commands sent to a remote machine are displayed on your screen. The verbose mode displays the recipient's responses and statistics about received bytes of information. $ ftp -vd The above command invokes ftp in verbose and debug mode, but does not open connections to the remote machine. $ ftp -ng ftp.botik.ru The above command invokes ftp with auto-registration and universal extension disabled, and causes a connection to be opened with the remote machine ftp.botik.ru. $ ftp -n -d The above command invokes ftp with auto-registration and generic extension removed without opening a connection to any machine.

Using the .netrc file for automatic registration.
You can create a file named .netrc in your home directory as an added convenience. This file contains registration data element strings for each machine you need for automatic communication. When you call ftp specifying a host, that is, when you open a connection to a host at the same time as calling it, ftp reads the .netrc file. If there is a member string for this machine, then ftp will automatically connect your machine to that remote machine. If you have opened the link in verbose mode, you will see how this happens. The file format consists of individual fields, represented by key fields:

Machine name login name password password where machine, login, password are keywords, followed by the character data required for registration:

machineNode name.
loginUser name for registration.
passwordThe password of the user on this node. The password is written in normal unencrypted text form. If you have included your password in the .netrc file, then you must disable this file for your group and all other users to prevent your password from being revealed. Otherwise, ftp will not allow you to use this file. For additional information see the documentation for the chmod command for file permissions. There is some risk in writing your password to a file. You must weigh all security conditions. Ask your administrator about all the features before using this file.
If you don't enter a password in the file, ftp will ask you for it. Here is an example entry in the .netrc file: machine admin login guido password open where: admin is the host name, guido is the user that logs into the admin machine, open is the password of the guido user.

Limit for ftp commands.
There are several advanced commands that provide additional convenience to the user. But not all ftp servers understand them. The commands whose use will be described later in this chapter have certain limitations. The ftp program can provide a list of supported commands. To obtain such information, you need to use the command after establishing a connection with the remote machine.

Description of ftp commands.
When the ftp prompt appears on the screen, you can enter one of the commands described later in this section. After executing the command, the ftp prompt will appear again. Depending on which mode is set: verbose or debug, additional messages may appear. After each command, press Enter. The command will not start until you press Enter. If you make a mistake while typing a command, you can use the BACKSPACE key to edit the text.

You do not need to enter the command name in full, you can enter a certain number of characters, sufficient for identification. In most cases, this is one or two characters from the name of the ftp command. However, it is better not to be lazy and to type commands completely. The fact is that the ftp client on the joker server can be changed system administrator. Not all clients understand short commands. For example, before they could be used. But one fine day, the ftp program was replaced. They put a more advanced version. I don’t know how advanced she is, but she doesn’t understand short commands.

! This command suspends ftp and invokes the command language (shell) on the local machine. Any character(s) after the exclamation point are treated and executed as shell commands. You can then return to ftp by exiting the shell. All ftp options and associated remote machines are returned to the same state they were in before this command was issued. If a shell command is printed on the same line as !, then only that command is executed. After executing the command, the ftp program returns to command mode.
appendThe append command causes ftp to append the contents of the local file to the end of the file on the remote machine you are currently connected to. When you call this command, you can specify which file to append to which, for example: ftp> append local_file_name file_name of remote_machine You can also use just the command name and then be prompted for filenames, for example: ftp> append (local-file) local_file_name ( remote-file) file_name of the remote_machine
asciiThis command causes ftp to convert files to ASCII code. By default, the code is always ASCII.
bellThis command causes a signal to appear on your terminal after each file transfer is completed. To stop beeping, you need to type this ftp command again.
binaryThis command causes ftp to transfer the file in binary.
quitThis command exits ftp. This command closes all open links.
cdThis command replaces the directory name on the remote machine with a new one. You can write a new name when you call the command, as shown in the example: ftp> cd /usr/bin You can only use the name of the ftp command, then the machine will ask for a new directory name, for example: ftp> cd (remote-directory) /usr/ bin
closeThis command closes the current connection. However, there is no exit from ftp. You can create another connection.
debugThis command turns debug mode on and off. If the mode is turned on, then a message appears on your display about this, there are no messages when you turn it off.
verboseThis command turns the verbose mode on and off. If the mode is turned on, then a message appears on your display about this, there are no messages when you turn it off.
deleteThis command deletes a file on the remote machine you are currently connected to. You can specify the name of the file to be deleted when calling the ftp command: ftp> delete filename to delete If you prefer, you can leave out the name when calling the ftp command. Then the machine will ask you for a name, for example: ftp> delete (remote-file) the name of the file to delete
dirThis command will give you the table of contents of the directory on the remote machine you are connected to. You can specify the name of the directory to be printed when invoking the ftp command. For example: ftp> dir /usr/bin If you don't specify a directory name, the current directory on the remote machine will be printed. You can also have ftp write the results of a command to a file before it appears on the screen. This is done as follows: ftp> dir /usr/bin printfile You must specify the directory name before the name of the output file (here printfile). Thus, if you want to print the current directory to a file called printfile, do this: ftp> dir . printfile where "." means the current directory.
getThis command copies a file from the remote machine you are currently connected to. This file is copied to your directory on the server. Use the mget command to copy multiple files at once. When you call this command, you can specify the name of the file on the remote machine and the name in your directory where you will copy the file. For example: ftp> get remote_machine_filename your_machine_file_name If you just specify the filename of the remote machine you want to copy, the file on your machine will have the same name. Example: ftp> get remote_machinename You can only write the ftp get command. Then the ftp program will ask you for a filename, for example: ftp> get (remote-file) filename of the remote machine (local-file) filename of your machine
globThis command causes ftp to disallow UNIX filename extensions, such as the generic "*". This command serves to both disable and enable the extension, so that if given again, the extension will be enabled again. After allowing the extension, ftp will append the extension to all filenames when listing files.
hashThis command causes ftp to display a "#" character on the screen after each block of data that is sent by the remote machine. The size of the data blocks may vary depending on the version. software. Today on the joker machine it is 1024 bytes. After entering this command, the current data block size will be printed. This command turns on and off the output of the "#" character on the screen when it is redialled. Thus, you will be able to evaluate the file transfer speed.
helpThis command displays information about ftp activity. If you specify a command name after help, then information about this command will appear. Simply typing help will bring up a list of ftp commands.
lcdThis command changes the working directory used by ftp on your machine. You can specify the name of the directory you want as a working directory, for example: ftp> lcd /home/student/your_dir_name If you don't specify a directory name, the current directory will be used.
lsThis command prints an abbreviated listing of the directory contents of the remote machine you are currently connected to. You can specify the name of the directory you want to print. For example: ftp> ls /usr/bin If you don't specify a name, the current directory will be printed. You can specify that the results of the command execution be placed in a file before they appear on the display. This is done by specifying the name of a file on your machine where the directory listing should be placed, for example: ftp> ls /usr/bin printfile The directory name must be set before the file is printed (here printfile). For example, if you want to print the current directory to a file named printfile: ftp> ls . printfile where "." put to emphasize that the directory is current.
mdeleteThis command deletes the list of files on the remote machine you are currently connected to. You can specify filenames to delete when calling the command. For example: ftp> mdelete remote_machine_file_name 1file_name... Otherwise, you can just use the command name. The ftp program will prompt you for the name(s): ftp> mdelete (remote-files) filename1filename2...
mdirThis command lists the directory listing of the remote machine and puts the result in a file in your directory. You can specify a list of files on the remote machine and a filename on your machine where to place the result when the command is invoked. For example: ftp> mdir filename of remote_machine... printfile Note that the last name is the name of a file in your directory. It's possible to just use the command name. The ftp program will then prompt you for the file name, for example: ftp> mdir (remote-files) remote_machine_file_name... printfile local-file printfile? y
mgetThis command copies several files from the remote machine you are currently connected to into your directory. Files after copying will have the same names as on the remote machine. You can specify a list of files to be copied: ftp> mget remote_machine_file1_name file_2name... If you didn't specify filenames when invoking the command, ftp will prompt you for them: ftp> mget (remote-files) remote_machine_file1_name file_2name...
mkdirThis command creates a directory on the remote machine you are currently connecting to. You can specify a directory name when invoking the command, for example: ftp> mkdir /u/mydir If you don't specify a directory name, ftp will prompt you for it, for example: ftp> mkdir (directory-name) directory_name Of course, to run this command, you must have write permission on the remote machine.
mlsThis command takes an abbreviated list of the group of files in the current directory on the remote machine and places the result in a file on your machine. You can specify a list of files on the remote machine and a file on your machine where to place the result when calling the command, for example: ftp> mls file_name of the remote_machine... printfile remote-files) file_name of remote_machine... printfile local-file printfile? y
mputThis command copies one or more files from your directory to the remote machine you are currently connected to. On the remote machine, the files will have the same names. Of course, you must have write permission on the remote machine to run this command. You can specify a list of files when you call the command, for example: ftp> mput 1 file_of_your_dir 2 file_of_your_machine... If you don't specify names, ftp will ask you about it: ftp> mput (local-files) file_1_name of_your_dir file_2_name...
nmapUse this command to set and unset the file name resolution mechanism. This command is useful when communicating with UNIX-incompatible machines that use a different way of naming files. For example, servers based on Apple Macintosh. Renaming local machine files is done with get and mget commands, and the remote machine with the put and mput commands.
ntransUse this command to enable or disable the filename character translation mechanism. This command is useful when connecting to a UNIX-incompatible remote machine that uses a different file naming convention. For example, servers based on Apple Macintosh. Translation of filenames on the local machine is done with the get and mget commands, and on the remote machine with the put and mput commands.
openThis command establishes a connection with a remote machine that is supposed to transfer files. When calling the command, you can specify the machine name, for example: ftp> open ftp.botik.ru If the name is not specified, the program will ask for it: ftp> open (to) machine name port on the remote machine. If a port is specified, then ftp will open communication on that port if it is preferred over the default. Port changes are made if you are asked about it or it is set by the system administrator. If the port is not set, then the program does not request it.
promptThis command prevents you from asking ftp for permission to move between files in multi-file commands such as mget. This command is enabled and disabled when redialling.
putThis command moves a file from your machine to the remote machine you are currently connected to. To transfer multiple files at the same time, use the mput command. You can specify the filename of your machine and the filename of the remote machine when you call the ftp command, for example: ftp> put yourfilename remote_machine_filename or ftp> put yourfilename Of course, you must have write permission on the remote machine to run this command. If you do not specify the name of the file(s), then the program will prompt you for them, for example: ftp> put (local-file) your_file_name (remote-file) file_name of the remote_machine If you do not specify the file name of the remote machine, then the put command will create a file on the remote machine with the same name as your machine.
pwdThis command prints the name of the current working directory on the remote machine you are currently connected to.
byeThe command is similar to the quit command mentioned above.
quoteThe command causes ftp to send the parameters you enter into the machine to the remote machine for execution. Options are ftp commands and other options. The commands that ftp supports can be displayed on the screen using the remotehelp command. You can enter this command when invoking the ftp program, for example: ftp> quote NLST If you specify only the command name, ftp will ask you for the command line to use, for example: ftp> quote (command-line to send) NLST This command follows use only on the advice of your system administrator.
recvThis command is the same as the get command above.
remotehelpThis command requests ftp help on the remote machine you are currently connected to. This information tells you what commands the remote machine supports.
renameThis command renames a file on the remote machine you are currently connected to. When calling the command, you can use filenames, for example: ftp> rename old_file_name new_file_name If you used only the command name, then ftp will ask for file names: ftp> rename (from-name) old_file_name (to-name) new_file_name Of course, to execute this command you must have write permission on the remote machine.
rmdirThis command deletes a directory on the remote machine you are currently connected to. You can specify the name of the directory to be deleted when the command is invoked, for example: ftp> rmdir /u/mydir or you can leave out the name when the command is invoked and the machine will prompt you for it: ftp> rmdir (directory-name) /u /mydir This command is not always supported by the remote machine. Of course, you must have write permission on the remote machine to run it.
sendThis command is similar to the put command above.
sendportThis command causes ftp to disable the ability to set the local machine port for remote machine data. This command can be enabled and disabled by typing it again. When calling ftp, a specific port is set by default. This command should be used on the advice of your system administrator. As a rule, it is only needed when working with some "wrong" ftp server that is incompatible with your client program.
statusThis command causes ftp to display its current status on your terminal. The status includes the modes that are selected by the bell, hash, glob, port, type commands.
typeThis command sets the format in which the file is transferred. ASCII and binary codes are allowed. This command is similar to the ascii and binary commands. If you didn't specify a type when calling the command, then ASCII is set.
userThis command allows you to identify yourself on the remote machine when establishing a connection. This auto-registration is enabled with the -n option when calling ftp. In this case, this command is not needed. If automatic registration is disabled, then use this command to register and authenticate yourself on the remote machine. The remote machine needs to be told three kinds of information about who you are: login, password, and resource name. The username is required for all machines, the password and share name are required only for some systems. You can enter all of this information when invoking the user command, for example: ftp> user mike cat myaccount You can leave out all of this information when invoking the command. Then the program will ask you about it, for example: ftp> user (usename) mike(username) password: Account: myaccount(sharename) Note that your password is not displayed when you type it to protect your information. If you have not typed a password or resource name, then you will not be prompted for them.
verboseThis command causes ftp to disable verbose mode. This command is turned on and off when redialling. In verbose ftp mode, protocol messages sent by a remote machine appear on your terminal. In addition, this mode displays statistics after each file is transferred. If this mode is disabled, then this information is not displayed.
? Another name for the help command.

FTP examples.
This section illustrates how ftp can be used. Below are three examples. These examples use two machines, a local machine named HERE and a remote machine named THERE.

Description of 1 example.
This example shows the use of ftp to send and receive files. The ftp command is called with the name of the host machine and the user is automatically logged on to another machine, because. the -n option is not used.

Verbose mode is disabled using the verbose command. The user then changes the working directory on the remote machine to the /etc directory. Because there is no -d option and there is a verbose command, verbose mode is disabled and no messages other than the ftp prompt appear.

The user, using the ls command, obtains an abbreviated listing of the /etc directory on THERE. the ftp command outputs three files in the /etc directory. The get passwd command then copies the passwd file from THERE to HERE. A file called passwd is created on machine HERE if a machine name was specified.

The put command is used to copy a file called wall from the current working directory of the local machine (HERE) to the /etc directory of the remote machine (THERE). This file is copied with the same name because its own name was not specified. After the transfer is complete, the /etc listing appears, which already has four files, including wall, which was just copied from the HERE machine.

The bye command is then used to return to the operating system shell on the local machine HERE.

$ ftp THERE Connected to THERE 220 THERE FTP server (Version 4.160 #1) ready Name (THERE:stevea): Password (THERE:stevea): 331 Password required for stevea. 230 User stevea logged in. ftp> verbose Verbose mode off. ftp> cd /etc ftp> ls passwd volcopy whodo ftp> get paswd ftp>put wall ftp> ls passwd volcopy wall whodo ftp> bye $ Description 2 examples.
This example illustrates the screen images that can be obtained using several ftp options. After calling ftp with the name of the remote host, the user invokes a command that will return the debug mode. The ftp command then prints messages to the screen indicating that the option is enabled. The user then changes the working directory on the remote machine to /etc. Because there are debugging and verbose modes, messages about sending commands to the remote machine (--> CWD / etc) and responses received from the remote machine (250 CWD command successful) will appear on the screen. Note that the cd command, which has the same form as the UNIX change directory command, is sent as a CDW command (change working directory on a remote machine). This command is used by ftp instead of cd so that it works independently of the system command.

Following the cd command, the user puts the pwd command to confirm the change to the working directory. The ftp commands will display on your screen the messages sent between your (local) and remote machine, and then the current working directory on the remote machine will appear. The user then types in the hash option, which prompts a message that the option is allowed. The get wall myfile command tells ftp to retrieve the wall file and place it in the file myfile in the current working directory on your machine. The ftp command will print messages sent between the local and remote machines about the start of a transfer and then print a hash label for each block of information received. After the transfer is completed, the screen displays statistics showing the time it took to transfer and the date the file was transferred. After receiving the file, the user closes the connection with the close command and exits ftp with the bye command.

$ ftp THERE Connected to THERE 220 THERE FTP server (Version 4.160 #1) ready Name (THERE:stevea): Password (THERE:stevea): 331 Password required for stevea. ftp> debug Debugging on (debug = 1) ftp> cd /etc ---> CDW /etc 200 CDW command okay. ftp> pwd ---> PWD 251 ftp> hash Hash mark printing on (1024 bytes/hash mark). ftp> get wall mefile ---> PORT 3,20,0,2,4,51 200 PORT command okay. ---> RETR wall 150 Opening data connection for wall (3.20.0.2.1075)(24384bytes #######################. 226 Transfer complete. 24550 bytes received in 12.00 seconds (2 Kbytes/s) ftp> close ---> QUIT 221 Goodbye.ftp> bye $

FTP is an important TCP/IP utility for transferring files between systems. One of the main advantages of FTP is its compatibility with many different remote host systems: files can be transferred between remote systems Windows 2000, Windows NT and UNIX, and even IBM servers such as AS/400. You can run the text-based FTP utility that comes with Windows 2000 and NT by typing ftp at the command prompt.

We list the 10 most useful commands FTP.

10. Help (or?). Many FTP commands can be entered in different ways. For example, Help and a question mark (?) perform the same function. Beginners should start with the Help command, after entering which the system provides the user with a complete list of FTP commands. To obtain short description commands should be entered? followed by the command name:

ftp>? open

9. Open. An FTP session usually begins with an Open command that establishes a connection to the specified FTP server (the remote host must be running an FTP service). Upon receiving the Open command, the system prompts for a user ID and password. Many FTP servers allow you to log in with an anonymous ID and a blank password. To establish communication with a computer named teca2, enter

ftp>open teca2

8. Quit (or Bye). The Quit command terminates any open session and exits the FTP shell:

ftp>quit

To close an open session without terminating FTP, use the Close command.

7.Pwd. The pwd command displays the directory on the remote machine that is currently connected to in an FTP session:

6.Ls. The Ls command lists the files and subdirectories located in the current directory on the remote computer. ls allows you to access remote files:

5. CD. If the desired file is not in the current directory of the remote system, you can use the Cd command to change to another directory. If a connection to a UNIX machine is established, then the remote directory is usually specified with a slash and a right-slash (in this case directory /downloads):

Ftp>cd /downloads

4.LCD. The Lcd command changes the current directory on the local machine. Any files received from a remote machine will be written to the current directory by default. To change the current local directory to C:emp, enter the command

Ftp>lcd C:emp

3. Bin (or Binary). By default, FTP transfers files in ASCII format, which is convenient for text files. But to transfer executable and .zip files, you need to change the transfer type to binary using the Bin command:

To return to ASCII mode, use the ASCII command.

2. Put (or Send). The Put command allows you to copy a local file to the current directory of a remote machine. To send a file named localfile.txt to the C:emp directory on the remote system, you need to enter the command

Ftp>put C: emp localfile.txt

1. Get (or Recv). The Get command is used to download files from the Internet (or from remote machines) to the current directory of the local machine. To get a file named remotefile.txt, enter the command

Ftp>get remotefile.txt

Michael Auty - science editor of the American Windows log NT Magazine, President of TECA, a software development and consulting company. He can be contacted at:

Team FTP implements file exchange with an FTP server on the Windows command line. Utility ftp.exe is included in the standard distribution kit of all versions of operating systems of the Windows family and allows you to exchange with the server both in command and interactive mode.

Command line format:

FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuffer] [-b :asyncbuffers] [-w:windowsize] [node]

-v- Disabling the display of responses from a remote server.
-n- Disable automatic login on initial connection.
-I- Disable interactive prompts when transferring multiple files.
-d- Enable debug mode.
-g- Disable globalization of filenames (see GLOB command).
-s:filename- Specify a text file containing FTP commands that will be executed automatically when FTP is started.
-a- Using the local interface to bind the connection.
-A- Anonymous connection to the server.
-x:send sockbuf- Overriding the default SO_SNDBUF buffer size (8192).
-r:recv sockbuf- Redefining the standard buffer size SO_RCVBUF (8192).
-b:async count- Overriding default async counter size (3)
-w:windowsize- Redefining the default size of the transmit buffer (65535).
node- Specify the name or IP address of the remote host to connect to.

Notes:

The mget and mput commands accept y/n/q options as YES/NO/QUIT.
- to stop executing commands, press the key combination CTRL+C.

When run without parameters, FTP enters interactive mode, waiting for user input. The prompt is displayed on the screen - ftp>.

To get a list of available commands, you can type a question mark or the command help

Command set:

!
?
append
ascii
bell
binary
bye
cd
close
literal
debug
dir
disconnect
get
glob
hash
help
lcd
ls
mdelete
mdir
mget
mkdir
mls
mput
open
prompt
send
put
pwd
quit
quote
recv
remotehelp
rename
rmdir
status
trace
type
user
verbose

You can get help on a specific command by typing a question mark or help and command name:

? connect
help connect

List of Windows FTP client commands:

! - Temporary transition from the FTP environment to the Windows command line (CMD.EXE) . To return to FTP, use the command EXIT
append adding data transferred file to the end of the existing one.
ascii- set file transfer mode in ascii format (text mode)
bell- sound signal at the end of the command.
binary- set file transfer mode in binary format
bye- end the FTP session and exit the program.
cd- change the current directory on the remote computer
close- termination of the FTP session (closing the connection opened by the command open)
delete- deleting the specified file on the remote computer
debug- switch to debug mode
dir
disconnect- end ftp session. Disconnecting from the FTP server without terminating the program.
get- receiving a file from an FTP server
glob- Switching the metacharacter extension of local file names. By default, this mode is enabled and allows you to use symbols * And ? in filename patterns.
hash- switching the output mode of the hash mark for each transferred buffer
help- output of help information on FTP commands
lcd- change the working directory of the local computer
literal- send arbitrary character string as ftp command
ls- display the contents of the directory of the remote computer
mdelete- delete multiple files
mdir- listing the contents of several FTP server directories
mget- receiving multiple files from an FTP server
mkdir- creating a directory on the FTP server
mls- displaying the contents of several directories of the remote computer
mput- send multiple files to FTP server open- open a connection (connect) to the FTP server
prompt- change the line in the prompt to enter commands in interactive mode.
put- single file transfer
pwd- display the name of the current working directory on the FTP server
quit- end the session and exit the program
quote- send an arbitrary command to the FTP server
recv- receiving a single file
remotehelp- get help from the FTP server
rename- file rename
rmdir- deleting a directory on the server
send- single file transfer
status- display of the current state of the session - to which server the connection is made, the type of transmitted data, the state of the modes changed by FTP commands
trace- switch tracing mode
type- setting file transfer type
user- changing the username in the exchange session with the FTP server
verbose- switching the detail mode when displaying messages

As can be seen from the list of listed commands, the standard FTP client in operating systems Windows supports a far from complete list of standard ftp commands and, what is most annoying, it does not support the command to switch to passive mode ( passv) exchange with the FTP server, which makes it unsuitable for communication with FTP servers, the connection to which is performed using network address translation technology NAT. In other words, a standard FTP client is not suitable for exchanging files with servers external to the client's subnet. This applies to everyone Windows versions, including Windows 10. It is this fact that determines the scope of the ftp.exe utility - only in local networks where a direct TCP connection between client and server is possible.

An example session using a Windows FTP client:

open 192.168.1.1- open connection to server 192.168.1.1
user admin- use username admin when connecting to the server. In response to this command, the server will request a password.
adminpass- entering a password for the user admin
ls- display a list of files and folders in a remote directory
get myfile.txt- accept file myfile.txt from the remote directory to the current local directory.
lcd C:\files- change the current local directory.
get myfile.txt- accept file myfile.txt from the remote directory to the current local directory (C:\files) .

When using the Windows FTP client in batch files, it is often used to launch the program in the control mode for FTP commands recorded in text file.

ftp -s:ftpcomm.txt- A list of commands is written to the ftpcomm.txt file, in the same order in which they would be entered in interactive mode. For example, to receive the binfile.bin file in the C:\temp directory.

If you notice an error, select a piece of text and press Ctrl + Enter
SHARE: