List of FTP commands for the Windows command line. Reminder on FTP commands (we work with FTP from the command line)

Today we will look at working with FTP server via command cmd line. As I said this method It is used quite rarely, at least by me, since it is easier to work through an FTP client. However, for writing automated scripts for exchanging data between your local machine and an FTP server, this knowledge will be very useful to you.

In this video we will not write a script, we will do this in the next video, but we will simply look at the basic commands for working with an FTP server via the command line.

Basic commands for working with an FTP server via the CMD command line

And first we need to launch the command line ( Start\Applications\Utilities\Command Prompt) or Win+R\cmd.

First of all, you need to switch to the mode of working with the FTP server; this is done through the command FTP

Enter USERNAME who has access to this server And PASSWORD

If we lead the team DIR then we will see a list of files and folders that are contained on the FTP server.

I will not talk about all the commands that are used to work with an FTP server via the command line, but only those that we need to write a script. These are mainly commands that allow us to copy files from the FTP server to our local computer and vice versa from the local computer to the FTP server.

You can always type the command HELP and you will see a list of supported commands, to find out the purpose of the command just enter HELP TEAM_NAME.

But the description here is very modest, so if you want to know more detailed description various teams, visit my website in the feature article. I will place the link in the description of this video.

I don't have access to directly write files to the root of this FTP server, but there is access to the htdocs folder, so let’s go to this folder first. This is done by commands CD FOLDER_NAME.

We see that we have nothing in this folder. Let's try copying some file here from our local computer. To do this on local computer let's create a folder, let's say I have it nod32_update since in one of the next videos I will talk about how to write a script for automatic update NOD32 antivirus. And let's create some Text Document acceptable 123.txt.

To copy the 123.txt file to the FTP server, enter the command PUT c:\nod32_update\123.txt. The file has been copied, we can check it with the command DIR. As you can see, the file was copied to exactly the folder to which we went through the command CD.

If we need to copy all files from specific folder on the local computer to a folder on the FTP server, then we need to specify the current local directory and the directory on the server.

We learned how to specify the directory on the server using the command CD

The local directory is specified using the command LCD, if we type it, we will see that the current directory is the folder with the current user’s profile. And since I’m going to copy files from another folder, I enter the command LCD PATH_TO_REQUIRED_FOLDER

What's the point, there is a team MPUT which copies files from local folder to a remote one and it does not ask which folders these are, so we need to provide this information.

In order to copy all files from a local folder to a remote folder, I specify the command MPUT *.*, Where *.* means all files located in the local folder.

Here we are asked a confirmation question for each file, whether we want to copy it or not, for this we live Enter. To prevent such confirmations from being displayed, there is a command PROMT disables interactive mode off.

Now let's try to do reverse action, namely, copy all files from a remote folder on the FTP server to a local one. This is done through the command MGET *.*.

As you can see, everything is fine, everything has appeared in our folder necessary files and now we can finish working with the FTP server through the command QUIT.

FTP commands are designed to exchange files between computers in private network or via the Internet.

There are three ways in which you can access FTP:

The first two are simple remedies, which allow you to use a browser or client application FTP - (such as FTP Voyager) to connect to an FTP server to share files. Using the command line interface, you enter a set of commands to send or receive files from other computers.

Operating Windows systems Macintosh X and Linux have built-in command line clients that can be used to establish an FTP connection. To initiate a connection on Windows, enter in CMD FTP commands and press Enter.

FTP Commands for the Windows Command Line

TeamDescription
! This command is used to switch between the operating system and FTP. To return from operating system The exit command is used to access the FTP command line.
? Display help for a command.
appendAdding text to local file.
asciiSwitch to ASCII data transfer mode.
bellEnables/disables the sound signal mode.
binarySet the binary file transfer mode.
byeExit FTP.
CDChange the current directory.
closeExit FTP.
deleteDeleting a file.
debugEnables/disables debug mode.
dirDisplays a list of files.

Dir -C = Output files in extended format.

Dir -1 = Lists files in alphabetical order.

Dir -r = Lists directories in reverse alphabetical order.

Dir -R = Lists all files in the current directory and subdirectories.

Dir -S = Lists files in alphabetical order.

disconnectexit from FTP.
getReceiving a file from a remote computer.
globToggles file extension settings. When disabled, filename arguments to the put and get commands are taken literally and are not expanded.
hashEnables/disables the display of the "#" sign. When enabled, a hash character (#) is displayed after every 1024 bytes of data transferred.
helpDisplays command information if the command is entered after help.
lcdDisplays the local directory in which the command was run. If a path is specified after the lcd command, it changes the current local directory.
literalSending an arbitrary string of characters as a command to a remote server, expecting a single response code.
lsThis ftp exe command displays files on a remote computer.
mdeleteDeleting multiple files.
mdirDisplay the contents of remote directories.
mgetReceiving multiple files.
mkdirCreating a directory on remote computer.
mlsDisplay the contents of several directories on a remote computer.
mputSending multiple files.
openEstablishes a connection.
promptEnables/disables the tooltip.
putSending one file.
pwdOutput the working directory.
quitEnding the ftp session.
quoteSending an arbitrary command.
recvReceiving a file.
remotehelpObtaining help about remote system commands.
renameRenames the file.
rmdirDeletes a directory on a remote computer.
sendSending one file.
statusDisplays the current status of enabled and disabled options.
traceEnables packet tracing.
TypeSets the file transfer type.
userSending user information to log into the server.
verboseEnables/disables the information mode.

FTP commands for Windows

FTP options for Windows command line

CMD options are used to change how FTP commands work. The command line option usually follows core team FTP via space. Here is a list of commonly used FTP command line options for Windows®:

Command line optionDescription
-vDisable display of responses from a remote server.
-nDisable automatic login upon initial connection.
-iDisabling interactive requests when sending multiple

Files.

-dEnabling debug mode, displays all FTP commands sent between the client and server.
-gDisable file extensions that allow wildcard characters in local file and path names.
-s:filenameSpecify a text file containing FTP commands that

Will be executed automatically when FTP is started. Spaces are not allowed in this parameter. Use this option instead of redirection (>).

-aUsing the local interface to bind the connection.
-w:windowsizeOverride standard size transmission buffer (65535).
computerSpecifying the name or IP address of the remote host to which you want to connect. Computer, if specified, must be the last parameter on the line.

FTP command line options for Windows

The console FTP client built into Windows and Mac OS X is a reliable tool for testing, troubleshooting and troubleshooting. Learning the above cmd ftp commands will help you share files between computers without installing additional software.

FTP is not a reliable method of exchange confidential information. Due to the limitations of this protocol, organizations typically use FTPS protocols and SFTP. Technology controlled transmission files ( MFT) supports these security protocols.

Translation of the article “ List of FTP commands for Windows command-line interface” was prepared by the friendly team of the Website Building from A to Z project.

Updated: 02/27/2019 by Computer Hope

Note: FTP is not an encrypted transmission, which means any data sent over it, including your username and password, could be read by anyone who may intercept your transmission. If you want a more secure transmission, we suggest using SFTP .

Connect using FTP

To connect to another computer using FTP at the MS-DOS prompt, command line, or Linux shell type FTP and press Enter. Once in FTP, use the open command to connect to the FTP server, as shown in the following example.

Open ftp.example.com

In the above example, you"d substitute example.com for the domain name or IP address of where you are connecting. An example would be open 192.168.1.12.

Note: By default, the open command uses the TCP port 21 to make the FTP connection. If a different TCP port is needed for connecting to the domain name or IP address you are using, enter the port number after the domain name or IP address in the open command.

Once connected, a username and password prompt will appear. Once these credentials have been entered, the server allows you to browse, send, or receive files, depending on your rights. Some servers may also allow anonymous logins using guest or an e-mail address.

Send and receive a file in FTP

To get files from the server onto your computer, use the get command as shown in the following example. In this example, you would get the file myfile.htm.

Get myfile.htm

Tip: If you want to get more than one file, use mget and wildcards. For example, if you wanted to get all files that end with .htm, you could type mget *.htm. Finally, if you do not want to be prompted as each file is being sent, make sure to type prompt to disable prompting.

To send a file from your computer to the computer you are connected to, assuming you have the rights, use the send command as shown in the following example. In this example, we are sending the myfile.htm to the current directory .

Send myfile.htm

It is important to realize that the files being sent must be in your local working directory, which is the directory you were in when you typed the FTP command. If you want to change to the directory that contains your files, use the lcd command. For example, in Windows, you"d type lcd c:\windows to set the local directory to the Windows directory.

FTP Commands

Depending on the version of FTP and the operating system being used, each of the following commands may or may not work. Typing -help or a ? will list the commands available to you. Below is a general description of FTP commands available in the Windows command line FTP command.

Command Information
! This command toggle back and forth between the operating system and FTP. Once back in the operating system, typing exit takes you back to the FTP command line.
? Access the help screen.
append Append text to a local file.
ascii Switch to ASCII transfer mode
bell Turns bell mode on or off.
binary Switches to binary transfer mode.
bye Exits from FTP.
CD Changes directory.
close Exits from FTP.
delete Delete a file.
debug Sets debugging on or off.
dir Lists files if connected.

dir -C will list the files in wide format.
dir -1 lists the files in bare format in alphabetic order
dir -r lists directory in reverse alphabetic order.
dir -R lists all files in current directory and subdirectories.
dir -S lists files in bare format in alphabetic order.

disconnect Exits from FTP.
get Grabs file from the computer to which you are connected.
glob Sets globbing on or off. When turned off the file name in the put and get commands is taken literally and wildcards are not used.
hash Sets hash mark printing on or off. When turned on for each 1024 bytes of data received a hash mark (#) is displayed.
help Access the help screen and displays information about command if command typed after help.
lcd Displays local directory if typed alone or if path typed after lcd will change local directory.
literal Sends a literal command to the connected computer with an expected one line response.
ls Lists files of the remotely connected computer.
mdelete Multiple delete.
mdir
mget Get multiple files.
mkdir Make directory.
mls Lists contents of multiple remote directories.
mput Sent multiple files
open Opens

FTP- important utility TCP/IP, designed for transferring files between systems. One of the main advantages of FTP is its compatibility with many different remote host systems: files can be sent between remote systems Windows 2000, Windows NT and UNIX, and even IBM servers such as AS/400. To run the FTP utility, which has text interface and supplied with Windows 2000 and NT, simply enter ftp on the command line.

Let's 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 get a brief description of the command, enter ? and then the command name:

Ftp>? open

9. Open. An FTP session typically begins with an Open command, which establishes a connection to the specified FTP server (the remote host must have an FTP service running). After receiving the Open command, the system requests a user ID and password. Many FTP servers allow you to register with an anonymous ID and empty password. To establish a connection with a computer named teca2, you need to enter

Ftp>open teca2

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

Ftp>quit

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

7. Pwd. The Pwd command displays the directory on the remote machine with which this moment connection established within an FTP session:

6. Ls. The Ls command displays a list of 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 is established to a UNIX machine, the remote directory is usually indicated by a forward slash (in in this case/downloads directory):

Ftp>cd/downloads

4. Lcd. The Lcd command changes the current directory on the local machine. Any files received from the remote machine will be written to the current directory by default. To change the current local directory to C: emp, you should 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 the 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 local machine. To get a file named remotefile.txt, you would enter the command

Ftp>get remotefile.txt

Michael Auty is the scientific editor of the American Windows NT Magazine and the president of TECA, a company specializing in software development and consulting services. He can be contacted at:

Hello everyone, today I’ll tell you about the ftp.exe utility as a tool for working with FTP servers.

To work with FTP servers, it is not at all necessary to use cumbersome (and sometimes not free) FTP clients; for simple operations, the one included in the OS is quite suitable Windows server 2008 R2 or Windows 7 command line utility ftp.exe.

To start it ftp.exe, you need to call the dialog box “ Execute» and dial ftp. The client will print the prompt string to command interpreter cmd.exe and will be immediately ready to work:

Syntax ftp.exe very simple and described in sufficient detail in the built-in help, which can be called with the command help:

IN help system ftp.exe exist brief descriptions all teams. They are called by the command help. Let's see, for example, what the command does dir. To do this, let's dial help dir:

Let's try to establish a connection with some ftp server. Let it be linuxcenter.ru. The team will help us with this open linuxcenter.ru:

After connecting to the ftp server, we need to tell it in what mode we will work with it. There are only two modes: port-mode channel And passive-mode data channel. In 99 cases out of 100 it is used passive mode(will tell you more about the differences Wikipedia), we inform the server that we are not an exception to the rule, with the command quote PASV:

Now we can begin performing operations with data: navigate through the directory structure and display their listings, upload and download files, change the formats of sent data, etc. However, ftp servers are different. Therefore, first it would be useful to familiarize yourself with the syntax supported remote server. There is a command for this remotehelp:

To close active connection, use the command close, to exit ftp.exe - quit. AND help to help you.

This is how you can still work with the ftp server.