The programmer must know the FTP command and the programmer's FTP command

Source: Internet
Author: User
Tags ftp commands ftp login ftp site remote ftp server

The programmer must know the FTP command and the programmer's FTP command

Programmers must know FTP commands

The format of the file transfer software is FTP <FTP address>. If the connection is successful, the system prompts the user to enter the user name and password:
LOGIN: (enter a valid user name or "ANONMOUS "):
PASSWORD: (enter a valid PASSWORD. If you log on as "ANONMOUS", you generally do not need a PASSWORD ):

Section 1 FTP command Basics

After you enter the FTP site you want to connect to, you can perform file transfer operations. Some important commands and similar commands are as follows:
1) HELP ,? , RHEIP, REMOTEHELP
The HELP command displays the LOCAL command instructions. If not, all available commands are displayed;
? Equivalent to HELP, for example :? CD:
RHELP is the same as HELP, but it is used to display REMOTE Command instructions;
REMOTEHELP is equivalent to RHELP.
2) ASC (ASCll), Bm (BmARY), IMAGE, TYPE
Switch the ASCII transmission mode to the text mode (only the DOC file can be transferred because it is 7-BIT );
Switch the BINARY transmission mode to the BINARY mode (this mode is used except for text files );
IMAGE is equivalent to BINARY:
TYPE allows you to change or display the current transmission mode.
3) BYE and QUIT[Quit]
BYE exit FTP:
QUIT is equivalent to BYE.
4) CD, CDUP, LCD, P ~ WD ,!
CD changes the current working directory, for example, CD \ PUB;[Cwd]
CDUP is returned to the previous directory, which is equivalent to playing CD ..:
LCD allows you to change or display LOCAL working directories, such as LCD \ TMP;
PWD displays the current working directory (REMOTE end ):
! Let you execute shell commands, such :! LS.
5) DELETE, MDELETE, and RENAME
DELETE:
Need MDELETE to delete files in batches? Or ,*
RENAME: Change the REMOTE file name.
6) GET, MGET, PUT, MPUT, RECV, and SEND
GET to download files;
MGET batch downloading files, which must be used with characters, for example, MGET *. GZ;
PUT: upload files;
MPUT: uploads files in batches, which must contain characters;
RECV is equivalent to GET (RECV is short for RECEWE ):
SEND is equivalent to PUT.
7) HASH, PROMPT, VERBOSE, STATUS, BELL
HASH switching # font size. Each font size indicates that 1024/8192 BYTES are transferred:
PROMPT switch iNTERACTIVEON/OFF;
VERBOSE switches the display of all file transfer processes;
STATUS displays the following parameters:
BELL sends a cry when the command is complete.
8) LS, DIR, MLS, MDIR, MKDIR, RMDIR
LS is a bit like the LS (LIST) command in UNIX:
DIR is equivalent to LS-L (LIST-LONG );
MLS only stores objects in a remote directory in a LOCAL file;
MDIR is equivalent to MLS;
MKDIR is like the MD (create sub-directory) in DOS:
RMDIR is the same as RD (delete sub-directory) in DOS.
9) OPEN, CLOSE, DISCONNECT, USER ·
OPEN connection to a remote FTP server;
CLOSE closes the current connection; DISCONNECT is equivalent to CLOSE;
Enter the USER name and password again (a bit like SU in UNIX ).
RETRSTOR
Section 2 FTP commands

The FTP command is one of the most frequently used commands by Intemet users. A large number of FTP Internal commands are encountered no matter how frequently FTP is used in DOS or UNIX operating systems. Familiar with and flexible application of FTP Internal commands can greatly facilitate users and get twice the result with half the effort.
The FTP command line format is:
FTP-v-d-I-n-g [host name], where:
-V -- display all response information of the remote server;
-N. ------ restrict automatic FTP login, that is, do not use ;,
N ----- etRc file:
-D -- use the debugging method:
· G -- cancel the global file name.
The internal commands used by FTP are as follows (brackets indicate optional ):
1) [crud [args) 1: Execute the interactive shell on the local machine, and exit to return to the FTP environment, with the column as follows :! LS *. zip.
2) $ macro-amc [args executes the macro definition macro-name.
3) accountlpassword]: Provides the supplemental Password required to successfully log on to the remote system and access system resources.
4) append local-file [remote-file]: append the local file to the remote system host. If the remote system file name is not specified, the local file name is used.
5) aSCii: Use the ascII transmission mode.
6) bell
7) bin: binary file transmission
8) bye .. exit the FTP session process-
9) case: when using mget, convert uppercase letters in the remote master file name to lowercase letters.
10) cdremote-dir: Enter the remote host directory.
11) cdup .. enter the parent directory of the remote host directory.
12) chmodmodefile-name: sets the file-name access method of the remote host file to mode. For example, chmod777a. OUt.
13) close: interrupt the FTP session with the remote server (corresponding to open ).
14) cr: When a file is transmitted using aSSC, the carriage return line is converted into a return line.
15) deleteremote-file-delete remote host files:[Dele]
16) debugldebug-value3:. Set the debug mode to display each command sent to the remote host. For example, if debup3 is set to 0, the debug is canceled.
17) dir [remote-dir] [Local-file]: displays the remote host directory and saves the result to the local file:
18) disconnection-. is the same as close.
19) formformat: sets the file transmission mode to format. The default mode is file.
20) getremote-file [10cal-file]: transfers the remote-file of the remote host to the local-file of the local hard disk.
21) glob: Set file name extension for mdelete, mget, and mput. The file name is not extended due to lack of time, which is the same as the-g parameter of the command line.
22) hash: A hash symbol (#) is displayed for every 1024 bytes transferred (#).
23) help [cmd]: displays the help information of the FTP Internal Command cmd, such as.-helpget.
24) idle [seconds]: sets the Sleep timer of the remote server to [seconds] seconds.
25) image: sets the binary transmission mode (the same as binary ).
26) LCD [DIR]: Switch the local working directory to dir.
27) LS [remote-DIR] [LOCAL-FILE]: displays the remote Directory remote-dir and stores the local-fileo
28) macdefmacro-name: defines a macro. When an empty row under macdef is encountered, the macro definition ends.
29) mdelete [remote-file]: delete remote host files.
30) mdirremote-fileslocal-file: similar to dlr, multiple remote files can be specified. For example, mdir *. O. *. zipoutfiLe.
31) mgetremote-files: Transfers multiple remote files.
32) mkdirdirname: create a directory on the remote host.[Mkd]
33) misremote-filelocal-file. It is the same as nlist, but multiple file names can be specified.
34) mode [modename]: sets the file transmission mode to modename. The default mode is stream.
35) modtimefile-name .. display the last modification time of the remote host file. ·
36) mputlocal-file: Transfers multiple files to the remote host,
37) newerfile-name: if the modification time of file-name on the remote machine is significantly closer than that of files with the same name on the local hard disk, the file will be re-transmitted. ·
38) nlist positive remote di41local-file3: displays the list of files in the remote host directory and stores the local-fileo [NLST]
39) nmap [npattem outpattem] sets the file name ing mechanism to convert some characters in the file during file transmission, such as nmapSl. s2.S3 [,] [,], transfer the file a1.a2. when a3, the file name is changed to a1. a20 this command is particularly applicable when the remote host is not a UNIX host.
40) ntrans [Inchars [outchars] sets the file name character translation mechanism. For example, if ntranslR is used, the file name LLI will be changed to RRR.
41) openhost [port]: Specifies the FTP server connection. You can specify the connection port.
42) passive: enters the passive transmission mode.[Pasv]
43) prompt: sets the interaction prompt when multiple files are transferred.
44) proxy FTP-cmd: Execute an FTP command in the secondary control connection. This command allows two FTP servers to be connected to transfer files between the two servers. The first FTP command must be open to first establish a connection between two servers.
45) putlocal-file [remote-file]: transfers the local-file to the remote host.
46) vwd: displays the current working directory of the remote host.
47) qmt-. Same as bye, quit the FTP session.
48) quote argl, arg2... : Send the parameter to the remote unload server, for example, quote or syst.
49) recvremote-file [Local-file): Same as get.
50) reget remote-file [Local-file]: similar to get, but if local-file exists, the transmission will continue from the last transmission interruption.
51) rhelp [cmd-name]: request help from the remote host.
52) rstatus [FILe-name]: If no FILe name is specified, the remote host status is displayed; otherwise, the FILe status is displayed,
53) rename [FRom) [to]: Change the remote host file name.[Rnfr] [rnto]
54) reset: Clear the answer queue.[Rest]
55) restart marker: Start get or put again from the specified mark marker, for example, restartl30.
56) rmdirdir-name: Delete the remote host directory.[Rmd]
57) mnique: Set file name uniqueness storage. If the file exists, add the suffix. 1,. 2 and so on to the original file.
58) send local-file [remote-file): Same as put
59) sendport: Set the PORT command.
60) siteargl, arg2... : Send the parameters as SITE commands to the remote unload host.
61) sizefile-name: displays the file size of the remote host, for example, Slteidle7200.[Size]
62) stares :. Displays the current FTP status. ·
63) struct [struct-name]: sets the file transmission structure to struct-name, and uses the stream structure due to lack of time.
64) suniclue: Set the remote host file name storage to unique (corresponding to mnique ).
65) system: displays the operating system type of the remote host.
66) tenex: sets the file: transfer type to the required type of the TENEX server.
67) tick: sets the byte counter during transmission.
68) trace: Set package tracing.
69) type [type-name): sets the file transfer type to type-name. The default value is ascii,
For example: typebinary, set the binary transmission mode.[Type I] [type a]
70) umask [newmask): Set the default umask of the remote server to newmask. For example, umask 3.
71) user-name [password Ⅱ account]: indicates your identity to the remote host. If you need a password, you must enter the password, for example, vashon @ emaiL.[User] [pass]
72) verbose: Same as the-v parameter of the command line, that is, set the detailed report mode. All the responses of the FTP server will be displayed to the user. The default value is on.
73 )? [Cmd]: Same as help.

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.