FTP command details (including operating instances)

Source: Internet
Author: User
Tags ftp commands ftp connection glob remote ftp server

FTP command details (including operating instances)

The following is the Microsoft command line FTP Client Command Daquan, if you want to use the "RAW" FTP command rather than the following translated please refer to: http://www.nsftools.com/tips/RawFTP.htm

Operating the instance Environment:

Host (FTP client): 192.168.65.1 window 7 64bit

Remote FTP server: 192.168.65.131 redhat 5 vsftp

Account: dylan

Password: dylan

1. Introduction to Option 1.1 of the command line

We use the following options in the command line to use FTP:
Ftp [-v] [-d] [-I] [-n] [-g] [-s: filename] [-a] [-w: windowsize] [computer]

·-V-Disable the display of Remote Server Information

·-N-Automatic Login prohibited

·-I-interaction notification disabled during multi-file transmission

·-D-enable debugging to display all commands passed between the client and the server

·-G-Disable the file name wildcard, which can be used in local files and path names

·-S: filename-specifies the text file containing the FTP command. The command runs automatically after FTP is started. There is no space in this parameter. Can be used instead of the redirection character (>.

·-A-use all local interfaces when binding data connections

·-W: windowsize-overwrite the default buffer size of 65535.

· Computer-specify the name or IP address of the remote computer. This parameter must be placed at the end.

1.2 operate the instance-v-Disable the display of Remote Server Information

Before use:

C: \ Users \ Administrator> ftp 192.168.65.131

Connect to 192.168.65.131.

220 ************** Welcome to blah vsFTP service .**************

User (192.168.65.131 :( none): dylan

331 Please specify the password.

Password:

230 Login successful.

Ftp> status

Connect to 192.168.65.131.

Type: ascii; details: On; ringtone: off; prompt: On; wildcard: On

Debug: off; print the hash mark: off.

Ftp> dir

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

Drwxrwxr-x 2 502 504 4096 Dec 07 ftp

-Rw-r -- 1 502 504 0 Dec 07 hello.txt

226 Directory send OK.

Ftp: 128 bytes received, 0.00 KB/second in 128.00 seconds.

After use:

C: \ Users \ Administrator> ftp-v 192.168.65.131

User (192.168.65.131 :( none): dylan

Password:

Ftp> dir

Drwxrwxr-x 2 502 504 4096 Dec 07 ftp

-Rw-r -- 1 502 504 0 Dec 07 hello.txt

-N-Automatic Logon Disabled

C: \ Users \ Administrator> ftp-n 192.168.65.131

Connect to 192.168.65.131.

220 ************** Welcome to blah vsFTP service .**************

C: \ Users \ Administrator> ftp-nv 192.168.65.131

Ftp> user dylan

Ftp> dir

Drwxrwxr-x 2 502 504 4096 Dec 07 ftp

-Rw-r -- 1 502 504 0 Dec 07 hello.txt

-I-interaction notification during multi-file transmission

Before use

Ftp> mget *. txt

Mget hello.txt? N

After use

Ftp> mget *. txt

Note: single file transmission does not affect

-D-enable debugging to display all commands passed by clients and servers

C: \ Users \ Administrator> ftp-nvd 192.168.65.131

Ftp> user dylan

---> USER dylan

---> PASS dylan

Ftp> dir

---> PORT 192,168, 236,113

---> LIST

Drwxrwxr-x 2 502 504 4096 Dec 07 ftp

-Rw-r -- 1 502 504 0 Dec 07 hello.txt

-G-Disable the file name wildcard, which can be used in local files and path names

Ftp> dir he *. txt

-Rw-r -- 1 502 504 0 Dec 07 hello.txt

Ftp> mget hell *. txt

Mget hell *. txt? Y

Failed to open file.

Ftp> get hell *. txt

Failed to open file.

-S: filename-specifies the text file containing the FTP command. The command runs automatically after FTP is started. There is no space in this parameter. Can be used instead of the redirection character (<.

Write a file containing FTP commands: dir. ftp

Open 192.168.65.131

User dylan

Dir

Call:

C: \ Users \ Administrator> ftp-ivns: e: \ ftp \ dir. ftp

Ftp> open 192.168.65.131

Ftp> user dylan

Ftp> dir

Drwxrwxr-x 2 502 504 4096 Dec 07 ftp

-Rw-r -- 1 502 504 0 Dec 07 hello.txt

Note: If you do not describe the others that are not commonly used, you will have the opportunity to add them later.

2 client commands 2.1 command Overview

·! -Execute local commands

·? -Display FTP command instructions

· Append-append a local file to the remote server

· Ascii-set the file transfer type to ASCII, default type

· Bell-trigger a bell when every transmission command is completed (disabled by default)

· Binary-sets the file transfer type to binary (binary transfer)

· Bye-ends the FTP session and exits

· Cd-change the remote working directory

· Close-end the FTP session and return the command line

· Debug-switch debugging (disabled by default)

· Delete-delete a remote single object

· Dir-display the list of subdirectories in the remote directory file box

· Disconnect-disconnect remotely and obtain the FTP prompt box again

· Get-copy a single remote file to a local device

· Glob-switch file name wildcard (ON by default)

· Hash-Toggles hash-sign (#) printing for each data block transferred (default = OFF) Prints "#" (hash mark printing) for each buffer transmission Switch)

· Help-display FTP Command help information (by default "? ")

· LCD-change the local working directory

· Literal-Sends arguments, verbatim, to the remote FTP server send parameters to the remote FTP server verbatim (send any ftp command)

· Ls-display a brief list of remote directory files and subdirectories (only file names and directory names are displayed)

· Mdelete-delete one or more remote files

· Mdir-list the contents of Multiple Remote Directories

· Mget-copy one or more remote files to the local device

· Mkdir-create a remote directory

· Mls-list the contents of Multiple Remote Directories

· Mput-copy one or more local files to a remote device

· Open-connect to the specified FTP Server

· Prompt-switch interaction prompt (ON by default)

· Put-copy a local file to a remote device

· Pwd-display the remote current working directory (literally: print the working directory)

· Quit-ends an FTP session and exits FTP (function-bye)

· Quote-Sends arguments, verbatim, to the remote FTP server (same as "literal") to send any ftp command ??

· Recv-copy a remote file to a local device

· Remotehelp-display Remote Command help

· Rename-rename a Remote File

· Rmdir-delete a remote directory

· Send-copy a local file to a remote device (put)

· Status-displays the current FTP connection status

· Trace-switch packet tracing (OFF by default)

· Type-set the file transfer type (ASCII by default)

· User-Send new user information

· Verbose-switch detail Mode

2.2 operate the instance! -Execute local commands

Ftp>! Dir

The volume in drive E is a document

The serial number of the volume is 0003-E430.

E: \ ftp directory

<DIR>.

<DIR> ..

Dir. ftp

10 localhello.txt

2 files in 52 bytes

2 directories, 51,202,547,712 available bytes

? -Display FTP command instructions

Append-append a local file to the remote server

Syntax: append local-file [remote-file]

NOTE: If remote-file is not specified, it is consistent with local-file by default.

[Dylan @ Redhat ~] $ Cat hello.txt

Ftp> append localhello.txt hello.txt

[Dylan @ Redhat ~] $ Cat hello.txt

Hello ftp.

Ftp> append hello.txt

[Dylan @ Redhat ~] $ Cat hello.txt

Hello ftp. hello there !!!

Ascii-set the file transfer type to ASCII, default type

Ftp> ascii

200 Switching to ASCII mode.

Binary-sets the file transfer type to binary (binary transfer)

Ftp> binary

200 Switching to Binary mode.

Bye-ends the FTP session and exits

Ftp> bye

C: \ Users \ Administrator>

Cd-change remote working directory

Ftp> cd ftp

Ftp> dir

-Rw-r -- 1 502 504 0 Dec 07 ftp.txt

Close-end the FTP session and return the command line

Ftp> close

Ftp> dir

Not connected.

Ftp> open 192.168.65.131

Ftp> user dylan

Password:

Debug-switch debugging (disabled by default)

Ftp> debug

Debug.

Ftp> dir

---> TYPE

---> PORT 192,168, 252,103

---> LIST

-Rw-r -- 1 502 504 0 Dec 07 ftp.txt

---> TYPE I

Delete-delete a single Remote File

Ftp> del ftp.txt

---> DELE ftp.txt

Dir-display the list of subdirectories of the remote directory file box

Ftp> dir

Drwxrwxr-x 2 502 504 4096 Dec 07 ftp

-Rw-r -- 1 502 504 24 Dec 07 hello.txt

Disconnect-disconnect from remote connection and obtain the FTP prompt box again

Ftp> disconn

Ftp> dir

Not connected.

Ftp> open 192.168.65.131

Ftp> user dylan

Password:

Get-copy a single remote file to a local device

Ftp> get hello.txt

Ftp>! Dir

Hello.txt

Glob-switch file name wildcard (ON by default)

Ftp> glob

Wildcard.

Ftp> mget *. txt

Failed to open file.

Help-display FTP Command help information (by using "? ")

Ftp> help dir

Dir: list the contents of a remote directory

LCD-change local working directory

Ftp> LCD e: \ ftp

The current local directory E: \ ftp.

Ls-display a brief list of remote directory files and subdirectories (only file names and directory names)

Ftp> ls

Ftp

Hello.txt

Mdelete-delete one or more remote files

Ftp> ls

1. tmp

2. tmp

3. tmp

Ftp

Hello.txt

Ftp> mdel *. tmp

Ftp> ls

Ftp

Hello.txt

Mdir-list the contents of Multiple Remote Directories

Ftp> mdir-ftp-

Drwxrwxr-x 2 502 504 4096 Dec 07 ftp

-Rw-r -- 1 502 504 24 Dec 07 hello.txt

Drwxr-xr-x 2 502 504 4096 Dec 07 tmp

-Rw-r -- 1 502 504 0 Dec 07 1.tmp

-Rw-r -- 1 502 504 0 Dec 07 2.tmp

-Rw-r -- 1 502 504 0 Dec 07 3.tmp

Mget-copy one or more remote files to the local device

Ftp> mget 1.tmp 2.tmp 3.tmp

Mkdir-create a remote directory

Ftp> mkdir tmp

Ftp> dir

Drwxrwxr-x 2 502 504 4096 Dec 07 ftp

-Rw-r -- 1 502 504 24 Dec 07 hello.txt

Drwxr-xr-x 2 502 504 4096 Dec 07 tmp

·

Mls-list contents of Multiple Remote Directories

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

Ftp> mls ftp-

Ftp/1.tmp

Ftp/2.tmp

Ftp/3.tmp

Mput-copy one or more local files to remote

Ftp> mput *. tmp

Ftp> ls

1. tmp

2. tmp

3. tmp

Open-connect to the specified FTP Server

Ftp> open 192.168.65.131

Ftp> user dylan

Password:

Prompt-switch interaction prompt (ON by default)

Ftp> mget *. tmp

Mget 1.tmp? N

Mget 2.tmp? N

Mget 3.tmp? N

Put-copy a local file to a remote device

Ftp> put 1.tmp

Pwd-display the remote current working directory (literally: print the working directory)

Ftp> pwd

257 "/usr/dylan"

Quit-ends the FTP session and exits FTP (bye)

Ftp> quit

C: \ Users \ Administrator>

Recv-copy a remote file to a local device

Ftp> recv 1.tmp

Remotehelp-display Remote Command help

Ftp> remotehelp CWD

214-The following commands are recognized.

ABOR ACCT ALLO APPE CDUP CWD DELE EPRT EPSV FEAT HELP LIST MDTM MKD

MODE NLST NOOP OPTS PASS PASV PORT PWD QUIT REIN REST RETR RMD RNFR

RNTO SITE SIZE SMNT STAT STOR STOU STRU SYST TYPE USER XCUP XCWD XMKD

XPWD XRMD

Rename-rename a Remote File

Ftp> rename 1.tmp 1. tmp. bak

Ftp> ls

1. tmp. bak

Rmdir-delete remote directory

Ftp> rmdir tmp

Send-copy a local file to a remote device (put)

Syntax: send local-file [remote-file]

Ftp> send 1.tmp

Status-displays the current FTP connection status

Ftp> status

Connect to 192.168.65.131.

Type: binary; details: off; ringtone: On; prompt: off; wildcard: On

Debug: off; print the hash mark: off.

Type-set the file transfer type (ASCII by default)

Ftp> type

Transfers files in binary mode.

Verbose-switch detail Mode

Ftp> verbose

The verbose mode is enabled.

3. Differences between the 3.1 ASCII and BINARY Modes

The difference between the ASCII mode and the BINARY mode is that the carriage return line breaks, while the binary mode does not process any data. The asci mode converts the carriage return line breaks to the carriage return characters of the local machine, for example, \ n under Unix, \ r \ n in Windows and \ r in Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.