Legal Information
PC Knowledge Base - FTP Command Reference

Good Knowledge Is Good2Use

OPEN

Establishes a connection to a host system. OPEN is a synonym for CONNECT. See CONNECT for more information.

FORMAT
OPEN host
PASSIVE

Enables or disables "passive" mode for file transfers with FTP servers on the opposite side of "firewall" gateways.

FORMAT
PASSIVE [state]
PARAMETERS
state - Specifies a value of ON, OFF, or TOGGLE.
DESCRIPTION

Typically, when an FTP client requests data from an FTP server, the server attempts to establish a connection with the client over which it transfers the data. If a "firewall" gateway separates the FTP client and server, the gateway may prohibit incoming connections. The solution is to enable "passive" mode transfers, in which the FTP server asks the FTP client to initiate the connection.
Note! Not all FTP servers support passive mode transfers.

The PASSIVE command lets you explicitly enable or disable passive mode. When you don't specify a state, the current state is toggled.

EXAMPLE

This example uses PASSIVE to allow the server to transfer a directory listing across a connection established by the FTP client rather than the server.

FTP>connect ftp.abc.com
Connection opened (Assuming 8-bit connections)
HQ.ABC.COM>user anonymous
Password:********************
HQ.ABC.COM>passive on
[Passive mode is ON for transfers]
HQ.ABC.COM>dir
FTP_ANON:[000000]
.INDEX;32 3 6-APR-1996 00:00 [WEBMASTER] R,RWED,RWED,R)
.WELCOME;4 2 16-MAR-1996 17:19 [WEBMASTER] R,RWED,RWED,R)
ABOUT.TXT;8 5 27-MAR-1996 14:54 [WEBMASTER] R,RWED,RWED,R)
COMPANY_INFORMATION.DIR;1|
1 3-JAN-1996 13:54 [WEBMASTER] (R,RWED,RWED,R)
CUSTOMER_SUPPORT.DIR;1
1 3-JAN-1996 13:55 [WEBMASTER] R,RWED,RWED,R)
544 27-MAR-1996 10:29 [WEBMASTER] R,RWED,RWED,R)
NFSACL.PS;1 72 27-MAR-1996 10:29 [WEBMASTER] R,RWED,RWED,R)
NFSACL.TXT;1 13 27-MAR-1996 10:29 [WEBMASTER] R,RWED,RWED,R)
PRODUCTS_AND_SERVICES.DIR;1
1 3-JAN-1996 13:58 [WEBMASTER] (R,RWED,RWED,R)
SERVER_MAP.TXT;54 60 6-APR-1996 00:04 [WEBMASTER] (RWED,RWED,RWED,R)
SET2048.MAR;2 5 27-MAR-1996 10:29 [WEBMASTER] (R,RWED,RWED,R)
THIRD_PARTY_TOOLS.DIR;1
1 3-JAN-1996 13:58 [WEBMASTER] (R,RWED,RWED,R)
UNZIP.EXE;3 155 27-MAR-1996 10:29 [WEBMASTER] R,RWED,RWED,R)
UNZIP_ALPHA.EXE;1 163 27-MAR-1996 10:29 [WEBMASTER] (R,RWED,RWED,R)
VMSIO.H;12 7 27-MAR-1996 10:29 [WEBMASTER] (R,RWED,RWED,R)
WHATS_NEW.TXT;1 1 5-MAR-1996 16:31 [WEBMASTER] (R,RWED,RWED,R)
Total of 1033 blocks in 15 files.
HQ.ABC.COM>

PASSWORD

Sends a password to the remote FTP server explicitly, which normally happens automatically during login.

FORMAT
PASSWORD password
PARAMETERS
password - Specifies the password to send to the remote server. The password is not echoed when typed.
Restrictions EXAMPLE

This example shows how to send a password to the remote host.

FLOWERS.COM>pass airplane
FLOWERS.COM>

PORT

Specifies a TCP port number to use for the FTP control connection. Use this command only when connecting to an FTP server that provides a nonstandard FTP control connection port number.

FORMAT
PORT port
PARAMETERS
port - Specifies the port to use when establishing the FTP control connection with the remote server system.
EXAMPLE

This example shows how to explicitly specify a port number for the FTP control connection with the remote host.

FLOWERS.COM>port 1099
FLOWERS.COM>

PROMPT-FOR-MISSING-ARGUMENTS

Turns on, off, or toggles (the default) whether or not FTP automatically prompts for missing command arguments.

FORMAT
PROMPT-FOR-MISSING-ARGUMENTS mode
PARAMETERS
mode - Specifies a value of ON, OFF, or TOGGLE.
EXAMPLE

This example shows how to use the PROMPT-FOR-MISSING-ARGUMENTS command.

FTP>prompt-for-missing-arguments
{Will NOT prompt for missing arguments];
SALES.FLOWERS.COM>get
?Missing remote filename
SALES.FLOWERS.COM>

PROMPT-ON-CONNECT

Turns on, off, or toggles (the default) whether or not FTP automatically prompts for a user name and password after making a connection.

FORMAT
PROMPT-ON-CONNECT mode
PARAMETERS
mode - Specifies a value of ON, OFF, or TOGGLE.
EXAMPLE

This example shows how to use PROMPT-ON-CONNECT to automatically prompt for a user name and password when a connection is made.

FTP>prompt-on-connect
[Will automatically prompt for username and password]
FTP>connect ftp.yod.com
Connection opened (Assuming 8-bit connections)
Username: HOLMES
Password:
FTP.YOD.COM>

PUSH

Starts and attaches a DCL subprocess. If a parent process exists, attach to it. To return from DCL, use the ATTACH or the LOGOUT command. To switch back from a DCL subprocess, use the ATTACH command. If the MULTINET_DISABLE_SPAWN logical is set, PUSH does not work.

FORMAT
PUSH
PUT

Copies local_file on the local host to remote_file on the remote host. The current settings for type, mode, and structure are used during file transfers. PUT is the same as SEND.

FORMAT
PUT local_file remote_file
PARAMETERS
local-file - Specifies the name of the file on the local host.
remote-file - Specifies the name of the file on the remote host.
QUALIFIERS
/FDL

Puts a file in FDL format. When you create a file with the PUT /FDL qualifier, a file description language (FDL) file is created at the same time as the original file. The output file is converted to raw block format. When you retrieve a file with GET /FDL, the original format is restored using the attributes stored in the FDL file. If you do not use the /FDL qualifier with the GET command, the new raw block format is retained. In any case, the FDL file is retained and must be deleted independently. The /FDL qualifier provides compatibility with DEC TCP/IP Services for OpenVMS (formerly UCX). The FDL file has the same name except the string FDL is appended to the end of the file name.Restrictions

EXAMPLES

This example copies the file LOGIN.COM to the remote file FOO.COM.

FLOWERS.COM>put login.com foo.com
FLOWERS.COM>

This example copies AFILE.TXT to BFILE.TXT and creates the additional BFILE.TXTFDL file. The BFILE.TXTFDL file is in ASCII format and is an appropriate FDL description of AFILE.TXT.

FLOWERS.COM>PUT /FDL AFILE.TXT BFILE.TXT
flowers.com

PWD

Displays the current working directory on the remote host. PWD is a synonym for SHOW-DIRECTORY. See SHOW-DIRECTORY for more information.

FORMAT
PWD
QUIT

Closes the current FTP connection and exits FTP. QUIT is a synonym for EXIT. See EXIT for more information.

FORMAT
QUIT
QUOTE

Sends a string to the FTP server verbatim. You can use QUOTE to access non-standard commands on the FTP server.

FORMAT
QUOTE string
PARAMETERS
string - Specifies a string to send to the server.
Restrictions

Use this command only when connected to a remote host.

EXAMPLE

This example shows how to send a NOOP command to the remote host.

FLOWERS.COM>quote noop
FLOWERS.COM>

RECEIVE

Copies remote-file from the remote host to local-file on the local host.The current settings for type, mode, and structure are used during file transfers. RECEIVE is a synonym for GET.

FORMAT
RECEIVE remote-file [local-file]
PARAMETERS
remote-file - Specifies the name of the file on the remote host.
local-file - Specifies the name of the file on the local host.
QUALIFIERS
/FDL

Gets a file previously saved with the PUT /FDL command. When you create a file with the PUT /FDL qualifier, a file description language (FDL) file is created at the same time as the original file. The output file is converted to raw block format. When you retrieve a file with RECEIVE /FDL, the original format is restored using the attributes stored in the FDL file.
If you do not use the /FDL qualifier with the RECEIVE command, the new raw block format is retained. In any case, the FDL file is retained and must be deleted independently. The /FDL qualifier provides compatibility with DEC TCP/IP Services for OpenVMS (formerly UCX). The FDL file has the same name except the string FDL is appended to the end of the file name.

Restrictions EXAMPLE

This example shows how to transfer a file to the local host.

FLOWERS.COM>receive login.com
To local file: Return
FLOWERS.COM>
RECORD-SIZE

Sets or displays the record size for IMAGE mode transfers.

FORMAT
RECORD-SIZE [size]
PARAMETERS
size - Specifies the record size for IMAGE mode transfers. Values range from 1 to 32767. When omitted, the current setting is displayed. The default record size is 512 bytes.
EXAMPLE
$ ftp ftp.yod.com
FTP.YOD.COM MultiNet FTP user process 4.2(nnn)
Connection opened (Assuming 8-bit connections)
FTP>record 1024
FTP>record
Record size for IMAGE files: 1024
FTP>

REMOTE-HELP

Displays information about commands available on the FTP server.

FORMAT
REMOTE-HELP
Restrictions

Use this command only when connected to a remote host.

EXAMPLE

This example shows how to retrieve help from a remote host.

UNIX.FLOWERS.COM>remote-help
's unimplemented).
< USER PORT STOR MSAM* RNTO NLST MKD CDUP
< PASS PASV APPE MRSQ* ABOR SITE XMKD XCUP
< ACCT* TYPE MLFL* MRCP* DELE SYST RMD STOU
< SMNT* STRU MAIL* ALLO CWD STAT XRMD SIZE
< REIN* MODE MSND* REST XCWD HELP PWD MDTM
< QUIT RETR MSOM* RNFR LIST NOOP XPWD
UNIX.FLOWERS.COM>

REMOVE-DIRECTORY

Deletes a directory on the remote host. REMOVE-DIRECTORY is the same as RMDIR.

FORMAT
REMOVE-DIRECTORY dir
PARAMETERS
dir - Specifies the name of the directory to be removed.
Restrictions EXAMPLE

This example shows how to delete the "test" subdirectory from the remote host.

FLOWERS.COM>remove-directory test
<"USERS:[HOLMES.TEST]" Directory deleted
FLOWERS.COM>

RENAME

Renames files on the remote host.

FORMAT
RENAME file1 file2
PARAMETERS
file1 - Specifies the name of the file to be renamed.
file2 - Specifies the new name of file1.
Restrictions EXAMPLE

This example shows how to rename COPY.COM to NEWCOPY.COM on the remote host.

FLOWERS.COM>rename Copy.com newcopy.com
FLOWERS.COM>

RETAIN

Turns on, off, or toggles (the default) the retention of OpenVMS version numbers in file transfers. By default, version numbers are stripped from OpenVMS file names before they are sent over the network.

FORMAT
RETAIN mode
PARAMETERS
mode - Specifies a value of ON, OFF, or TOGGLE.
EXAMPLE

This example shows how to enable retention of OpenVMS version numbers.

FTP>retain
[Transferred files will retain their version numbers]
FTP>

RM

Deletes a file on the remote host. RM is a synonym for DELETE. See DELETE for more information.

FORMAT
RM file
RMDIR

Deletes a directory on the remote host. RMDIR is a synonym for REMOVE-DIRECTORY. See REMOVE-DIRECTORY for more information.

FORMAT
RMDIR dir


Search Knowledge Base Feedback
If you like our web site refer a friend.
Your friends name.
Your friends email address.
Your Name
Your Email Address


© Copyright 1998-1999 GOOD2USE