Ftp

This connectivity command transfers files to and from a computer running an FTP service. The ftp command can be used interactively or by processing ASCII text files.

Syntax

ftp [-v] [-n] [-i] [-d] [-g] [host] [-s: filename]

Parameters

-v

Suppresses display of remote server responses.

-n

Suppresses autologon upon initial connection.

-i

Turns off interactive prompting during multiple file transfers.

-d

Enables debugging, displaying all FTP commands passed between the client and server.

-g

Disables filename globbing, which permits the use of wildcard characters in local file and path names. (See the FTP glob command.)

host

Specifies the host name or IP address of the remote host to connect to.

-s: filename

Specifies a text file containing FTP commands; the commands will automatically run after ftp starts. Use this switch instead of redirection (>).

To use the ftp command

The following table shows the FTP commands available when Microsoft TCP/IP is installed on a computer.

FTP Commands in Microsoft TCP/IP

Command

Purpose

!

Runs the specified command on the local computer.

?

Displays descriptions for ftp commands. Identical to help.

append

Appends a local file to a file on the remote computer, using the current file type setting.

ascii

Sets the file transfer type to ASCII, the default.

bell

Toggles a bell to ring after each file transfer command is completed. By default, the bell is off.

binary

Sets the file transfer type to binary.

bye

Ends the FTP session with the remote computer and exits ftp.

cd

Changes the working directory on the remote computer.

close

Ends the FTP session with the remote server and returns to the command interpreter.

debug

Toggles debugging. When debugging is on, each command sent to the remote computer is printed, preceded by the string --->. By default, debugging is off.

delete

Deletes files on remote computers.

dir

Displays a list of a remote directory's files and subdirectories.

disconnect

Disconnects from the remote computer, retaining the ftp prompt.

get

Copies a remote file to the local computer, using the current file transfer type.

glob

Toggles filename globbing. Globbing permits use of wildcard characters in local file or path names. By default, globbing is on.

hash

Toggles hash-mark (#) printing for each 2048 bytes data block transferred. By default, hash-mark printing is off.

help

Displays descriptions for FTP commands.

lcd

Changes the working directory on the local computer. By default, the current directory on the local computer is used.

literal

Sends arguments, verbatim, to the remote FTP server. A single FTP reply code is expected in return.

ls

Displays an abbreviated list of a remote directory's files and subdirectories.

mdelete

Deletes multiple files on remote computers.

mdir

Displays a list of a remote directory's files and subdirectories. Allows you to specify multiple files.

mget

Copies multiple remote files to the local computer using the current file transfer type.

mkdir

Creates a remote directory.

mls

Displays an abbreviated list of a remote directory's files and subdirectories.

mput

Copies multiple local files to the remote computer, using the current file transfer type.

open

Connects to the specified FTP server.

prompt

Toggles prompting. During multiple file transfers, ftp provides prompts 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.

put

Copies a local file to the remote computer, using the current file transfer type.

pwd

Prints the current directory on the remote computer.

quit

Ends the FTP session with the remote computer and exits ftp.

quote

Sends arguments, verbatim, to the remote FTP server. A single FTP reply code is expected in return. Identical to literal.

recv

Copies a remote file to the local computer, using the current file transfer type. Identical to get.

remotehelp

Displays help for remote commands.

rename

Renames remote files.

rmdir

Deletes a remote directory.

send

Copies a local file to the remote computer, using the current file transfer type. Identical to put.

status

Displays the current status of FTP connections and toggles.

trace

Toggles packet tracing; displays the route of each packet when running an FTP command.

type

Sets or displays the file transfer type.

user

Specifies a user to the remote computer.

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.