Windows command line FTP client – commands.

The following is a listing of commands with short explanation, available with MS Windows command line FTP client.

ftp> !
Runs the specified command on the local host.

Usage:! {command}

Parameters explanation:
command – Specifies the command to run on the local host. If command is omitted, the local command prompt is displayed; type "exit" to return to ftp.
—–
ftp> ?
Displays descriptions for ftp commands. ? is identical to help.

Usage:? {command}

Parameters explanation:
command – Specifies the name of the command about which you want a description. If command is not specified, ftp displays a list of all commands.
—–
ftp> append
Appends a local file to a file on the remote host using the current file type setting.

Usage:append local_file {remote_file}

Parameters explanation:
local_file – Specifies the local file to add.
remote_file – Specifies the file on the remote host to which local_file will be added. If remote_file is omitted, the local filename is used for the remote filename.
—–
ftp> ascii
Sets the file transfer type to ASCII, the default.

Usage:ascii

Note
FTP supports two file transfer types, ASCII and binary image. ASCII should be used when transferring text files. See also binary.

In ASCII mode, character conversions to and from the network standard character set are performed. For example, end-of-line characters are converted as necessary, based on the target operating system.
—–
ftp> bell
Toggles a bell to ring after each file transfer command is completed. By default, the bell is off.

Usage:bell
—–
ftp> binary
Sets the file transfer type to binary.

Usage:binary

Note
FTP supports two file transfer types, ASCII and binary image. Binary should be used when transferring executable files. In binary mode, the file is moved byte-by-byte. See also ascii.
—–

ftp> bye
Ends the FTP session with the remote host and exits ftp.

Usage:bye
—–
ftp> cd
Changes the working folder on the remote host.

Usage:cd remote-folder

Parameters explanation:
remote-folder – Specifies the folder on the remote host to change to.
—–
ftp> close
Ends the FTP session with the remote server and returns to the command interpreter.

Usage:close
—–
ftp> debug
Toggles debugging. When debugging is on, each command sent to the remote host is printed, preceded by the string —>. By default, debugging is off.
Usage:debug
—–
ftp> delete
Deletes a single file on a remote host. See also mdelete, which can delete multiple files.

Usage:delete remote_file

Parameters explanation:
remote_file – Specifies the file to delete.
—–
ftp> dir
Displays a list of a remote folder”s files and subdirectories. See also mdir, which can list multiple directories.

Usage:dir {remote-folder} {local-file}

Parameters explanation:
remote-folder – Specifies the folder for which you want to see a listing. If no folder is specified, the current working folder on the remote host is used.
local_file – Specifies a local file to store the listing. If not specified, output is displayed on the screen.
—–
ftp> disconnect
Disconnects from the remote host, retaining the ftp prompt.

Usage:disconnect
—–
ftp> get
Copies a remote file to the local host using the current file transfer type. See also mget, which can copy multiple files.

Usage:get remote_file {local-file}

Parameters explanation:
remote_file
Specifies the remote file to copy.
local-file
Specifies the name to use on the local host. If not specified, the file is given the remote_file name.
—–
ftp> glob
Toggles filename globbing. Globbing permits use of wildcard characters in local file or path names. By default, globbing is on.

Usage:glob
—–
ftp> hash
Toggles hash-sign (#) printing for each data block transferred. The size of a data block is 2048 bytes. By default, hash mark printing is off.

Usage:hash
—–
ftp> help
Displays descriptions for ftp commands.

Usage:help {command}

Parameters explanation:
command – Specifies the name of the command about which you want a description. If command is not specified, ftp displays a list of all commands.
—–
ftp> lcd
Changes the working folder on the local host. By default, the working folder is the folder in which ftp was started.

Usage:lcd {folder}

folder – Specifies the folder on the local host to change to. If folder is not specified, the current working folder on the local host is displayed.
—–
ftp> literal
Sends arguments, verbatim, to the remote FTP server. A single FTP reply code is expected in return.

Usage:literal argument

Parameters explanation:
argument – Specifies the argument to send to the FTP server.
—–
ftp> ls
Displays an abbreviated list of a remote folder”s files and subdirectories.

Usage:ls {remote-folder} {local-file}

Parameters explanation:
remote-folder – Specifies the folder for which you want to see a listing. If no folder is specified, the current working folder on the remote host is used.
local_file – Specifies a local file to store the listing. If not specified, output is displayed on the screen.
—–
ftp> mdelete
Deletes one or more files on a remote host.

Usage:mdelete remote_files

Parameters explanation:
remote_files – Specifies the remote files to delete.
—–
ftp> mdir
Displays a list of a remote folder”s files and subdirectories. Mdir allows you to specify multiple files.

Usage:mdir remote_files local_file

Parameters explanation:
remote_files – Specifies the folder for which you want to see a listing. Remote_files must be specified; type "-" to use the current working folder on the remote host.
local_file – Specifies a local file to store the listing. Type "-" to display the listing on the screen.
—–
ftp> mget
Copies one or more remote files to the local host using the current file transfer type.

Usage:mget remote_files

Parameters explanation:
remote_files – Specifies the remote file(s) to copy to the local host.
—–
ftp> mkdir
Creates a remote folder.

Usage:mkdir folder

Parameters explanation:
folder – Specifies the name of the new remote folder.
—–
ftp> mls
Displays an abbreviated list of a remote folder”s files and subdirectories.

Usage:mls remote_files local_file

Parameters explanation:
remote_files – Specifies the files for which you want to see a listing. Remote_files must be specified; type "-" to use the current working folder on the remote host.
local_file – Specifies a local file to store the listing. Type "-" to display the listing on the screen.
—–
ftp> mput
Copies one or more local files to the remote host using the current file transfer type.

Usage:mput local-files

Parameters explanation:
local-files – Specifies the local files to copy to the remote host.
—–
ftp> open
Connects to the specified FTP server.

Usage:open host {port}

Parameters explanation:
host – Specifies the remote host to connect to. Host can be specified by IP address or host name (a DNS or HOSTS file must be available). If auto-login is on (default), FTP also attempts to automatically log the user in to the FTP server (see Ftp command-line options to disable auto-login).
port – Specifies a port number to use to contact an FTP server.
—–
ftp> prompt
Toggles prompting. Ftp prompts during multiple file transfers to allow you to selectively retrieve or store files; mget and mput transfer all files if prompting is turned off. By default, prompting is on.

Usage:prompt
—–
ftp> put
Copies a local file to the remote host using the current file transfer type. See also mput, which can copy multiple files.

Usage:put local_file {remote_file}

Parameters explanation:
local_file – Specifies the local file to copy.
remote_file – Specifies the name to use on the remote host. If not specified, the file is given the local_file name.
—–
ftp> pwd
Displays the current folder on the remote host.

Usage:pwd
—–
ftp> quit
Ends the FTP session with the remote host and exits ftp.
Usage:quit
—–
ftp> quote
Sends arguments, verbatim, to the remote FTP server. A single FTP reply code is expected in return. Quote is identical to literal.

Usage:quote argument

Parameters explanation:
argument – Specifies the argument to send to the FTP server.
—–
ftp> recv
Copies a remote file to the local host using the current file transfer type. Recv is identical to get.

Usage:recv remote_file {local-file}

Parameters explanation:
remote_file – Specifies the remote file to copy.
local_file – Specifies the name to use on the local host. If not specified, the file is given the remote_file name.
—–
ftp> remotehelp
Displays help for remote commands.

Usage:remotehelp {command}

Parameters explanation:
command – Specifies the name of the command about which you want help. If command is not specified, ftp displays a list of all remote commands.
—–
ftp> rename
Renames remote files.

Usage:rename filename newfilename

Parameters explanation:
filename – Specifies the file you want to rename.
newfilename – Specifies the new filename.
—–
ftp> rmdir
Deletes a remote folder.

Usage:rmdir folder

Parameters explanation:
folder – Specifies the name of the remote folder to delete.
—–
ftp> send
Copies a local file to the remote host using the current file transfer type. Send is identical to put.

Usage:send local_file {remote_file}

Parameters explanation:
local_file – Specifies the local file to copy.
remote_file – Specifies the name to use on the remote host. If not specified, the file is given the local_file name.
—–
ftp> status
Displays the current status of FTP connections and toggles.
Usage:status
—–
ftp> trace
Toggles packet tracing; trace displays the route of each packet when running an ftp command.

Usage:trace
—–
ftp> type
Sets or displays the file transfer type.

Usage:type {type-name}

Parameters explanation:
type-name – Specifies the file transfer type; the default is ASCII. If type-name is not specified, the current type is displayed.
Note
FTP supports two file transfer types, ASCII and binary image.
ASCII should be used when transferring text files. In ASCII mode, character conversions to and from the network standard character set are performed. For example, end-of-line characters are converted as necessary, based on the destination”s operating system.
Binary should be used when transferring executable files. In binary mode, the file is moved byte-by-byte.
—–
ftp> user
Specifes a user to the remote host.

Usage:user user-name {password} {account}

Parameters explanation:
user-name – Specifies a user name with which to log in to the remote host.
password – Specifies the password for user-name. If not specified, but required, ftp prompts for the password.
account – Specifies an account with which to log on to the remote host. If account is not specified, but required, ftp prompts for the account.
—–
ftp> verbose
Toggles verbose mode. If on, all ftp responses are displayed; when a file transfer completes, statistics regarding the efficiency of the transfer are also displayed. By default, verbose is on.

Usage:verbose
—–

Filed Under: Windows Command Line FTP

Anthony Gee About the Author: Anthony G. is an IT specialist with more than 9 years of solid working experience in the Web Hosting industry. Currently works as server support administrator, involved in consultative discussions about Web Hosting and server administration. One of the first writers in the Onlinehowto.net website, now writing for Free Tutorials community - he is publishing tutorials and articles for the wide public, as well as specific technical solutions.

Leave a Reply