ftp

This connectivity command transfers files to and from a computer running an FTP service. Ftp 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 glob command in the online Command Reference.)

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 automatically run after ftp starts. Use this switch instead of redirection (>).

The following table shows the ftp commands available when the FTP service is installed on a Windows NT computer. For details about syntax for individual ftp commands, choose the ftp commands topic in the Commands list in Command Reference.

Table A.1 FTP Commands in Windows NT

Command

Purpose

!

Runs the specified command on the local computer.

?

Displays descriptions for ftp commands. ? is 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, which is 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-sign (#) printing for each data block transferred. The size of a data block is 2048 bytes. By default, hash-sign 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 files on remote computers.

mdir

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

mget

Copies 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 local files to the remote computer using the current file transfer type.

open

Connects to the specified FTP server.

prompt

Toggles prompting. Ftp prompts during multiple file transfers to enable 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

Displays 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. Quote is identical to literal.

recv

Copies a remote file to the local computer using the current file transfer type. Recv is 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. Send is identical to put.

status

Displays the current status of FTP connections and toggles.

trace

Toggles packet tracing; trace 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.