What are the ftp commands?

A FTP client commands can vary from client to client. There are some standard commands available with FreeBSD FTP client. You have to start FTP program before using the commands from the DOS prompt as shown,

C :\> ftp

This will start the FTP session. Following is a list commands which can be executed from FTP client.

!

Syntax: ! [command]

Executes the specified command on the local computer.

?

Syntax: ? [command]

Displays description for FTP commands which is similar to HELP.

Append

Syntax: append local file [remote file]

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

ASCII

Syntax: ascii

Sets the file transfer type to ASCII which is default.

Bell

Syntax: bell

Enables a bell sound after completion of every file transfer command. By default it is OFF.

Binary

Syntax: binary

Sets file transfer type to binary.

Bye

Syntax: bye

It ends FTP session with remote computer exiting FTP.

Cd

Syntax: cd remote directory

Changes to working directory on the remote computer.

Close

Syntax: close

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

Delete

Syntax: delete remote-file

Deletes a file on the remote computer.

Debug

Syntax: debug

It switches debugging mode. By default it is OFF. Each command sent to the remote computer is printed, preceded by the string ‘—->’ when debugging is ON.

Dir

Syntax: dir [remote-directory] [local-file]

It works same DOS dir command. Displays a list of remote directories files and subdirectories.

Disconnect

Syntax: disconnect

It disconnects from the remote server leaving the ftp prompt.

Get

Syntax: get remote-file [local-file]

It copies a remote file to a local computer using default file transfer type.

Glob

Syntax: glob

It allows user to use wildcard characters in a local file or path names, default it is ON.

Hash

Syntax: hash [size]

It switches hash-sign (#) printing for each data block transferred by default it is 1024 bytes.
User can change it specifying actual size in bytes.

Help

Syntax: help [command]

It displays the description of the specified command.

Icd

Syntax: icd [directory]

It changes the working directory of the local machine. If directory is not specified then it uses user’s directory.


Literal

Syntax: literal argument

It sends arguments to the remote computer. A single FTP code is received in return.

Ls

Syntax: ls [remote-directory] [local-file]

It works as DIR command.

Mdelets

Syntax: mdelate [remote-files]

Deletes multiple files on remote computer.

Mdir

Syntax: mdir remote-files local-files

It displays a list of remote directory’s files and subdirectories allowing user to specify multiple files.

Mget

Syntax: mget [remote-files]

Used to copy multiple files to a local computer using default file transfer type.

Mkdir

Syntax: mkdir directory

Creates a remote directory.

Mls

Syntax: mls [remote-files] [local-file]

Displays the details of remote path by default it displays current directory path.

Mput

Syntax: mput [local-files]

Used to copy multiple files to the remote computer using default file transfer type.

Open

Syntax: open host [port]

It connects specified FTP host server. An additional port number can be supplied where FTP server tries to connect.



Prompt

Syntax: prompt

Switches prompting by default it is ON. It allows user to selectively retrieve or store files during file transfer.

Put

Syntax: put [local-file] [remote-file]

It is similar to mput but it copies single file at a time.

Pwd

Syntax: pwd

It shows the current working directory on the remote computer.

Quit

Syntax: quit

It ends the FTP session with remote computer exiting FTP.

Quote

Syntax: quote argument […]

This command is similar to ‘Literal’

Recv

Syntax: recv remote-file [local-file]

This command works similar to ‘get’ command.

Remotehelp

Syntax: remotehelp [command]

Shows help for remote commands.

Rename

Syntax: rename [filename] [new filename]

Used to rename remote files.

Rmdir

Syntax: rmdir [directory]

Used to delete remote directory.

Send

Syntax: send local-file [remote-file]

It works similar to ‘put’ command.

Status

Syntax: status

Shows current status of FTP connections.

Trace

Syntax: trace

It displays route of each packet and toggles.

Type

Syntax: type [type-name]

Displays file transfer type also used to set file transfer type.

User

Syntax: user username [password [account]]

Used to identify user itself to remote FTP server.

Verbose

Syntax: verbose

By default it is ON. It displays all responses from FTP server to user. After completion of a file transfer all statistics regarding transfer efficiency are displayed when verbose is ON.

All above commands are supported by MS-Windows XP FTP client.