FTP commands are one of the most frequently used commands by Internet users. Whether using FTP in DOS or UNIX operating systems, a large number of FTP Internal commands are encountered. You are familiar with and flexible to use ftp Internal commands, it is very convenient for users. For users who use dial-up Internet access now, If the ISP provides shell and can use nohup, FTP will be the most cost-effective download method. The FTP command line format is: FTP-v-d-I-n-g [host name]
-V: displays all the response information of the remote server.
-D. Use the debugging method.
-N restrict FTP automatic logon, that is, the. netrc file is not used.
-G cancels the global file name.
The internal commands used by FTP are as follows (brackets indicate the option ):
1 .! [Cmd [ARGs] execute Interactive Shell and exit on the local machine to return to the FTP environment, as shown in! Ls *. Zip.
2. $ macro-Ame [ARGs]: Execute macro definition macro-name.
3. Account [Password] provides the supplemental Password required to successfully log on to the remote system and access system resources.
4. appendlocal-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 is transmitted in ASCII format.
6. After each command is executed, the computer rings once.
7. Bin transfers binary files.
8. Bye exits the FTP session.
9. When mget is used, convert uppercase letters in the remote host file name to lowercase letters.
10. Run CD remote-Dir to enter the remote host directory.
11. cdup enters the parent directory of the remote host directory.
12. chmod modefile-Name: Set the file-name access mode of the remote host file to mode, for example, chmod 777 A. Out.
13. Close interrupts the FTP session with the remote server (corresponding to open ).
14. When Cr transfers a file using asscii, it will convert the carriage return line into a return line.
15. Delete remote-file: delete remote host files.
16. debug [debug-value] sets the debugging mode. Each Command sent to the remote host is displayed, for example, debup3. If it is set to 0, the debug is canceled.
17. dir [Remote-Dir] [local-file] displays the remote host directory and stores the result in local-file.
18. disconnection is the same as close.
19. Form Format sets the file transmission mode to format. The default mode is file.
20. getremote-file [local-file] transfers the remote-file of the remote host to the local-file of the local hard disk.
21. glob sets the file name extension for mdelete, mget, and mput, which is the same as the-G parameter of the command line.
22. A hash symbol (#) is displayed for every 1024 bytes of hash transmitted (#).
23. Help [cmd] displays the help information of the FTP Internal Command cmd, such as help get.
24. idle [seconds] sets the Sleep timer of the remote server to [seconds] seconds.
25. Set binary transmission mode for image (same as binary)
26. LCD [dir] switches the local working directory to Dir.
27. ls [Remote-Dir] [local-file] displays the remote Directory Remote-Dir and stores it in local-file.
28. macdef macro-name defines a macro. When an empty row under macdef is encountered, the macro definition ends.
29. mdelete [Remote-file] deletes remote host files.
30. mdir remote-files local-file is similar to Dir, but multiple remote files, such as mdir *. O. *. zipoutfile, can be specified.
31. mget remote-files transfers multiple remote files.
32. mkdir Dir-Name: create a directory on the remote host.
33. MLS remote-File Local-file is the same as NLIST, but multiple file names can be specified.
34. mode [mode-name] sets the file transmission mode to Mode-name. The default mode is stream.
35. modtime file-Name: displays the last modification time of the remote host file.
36. mput local-file transfers multiple files to the remote host.
37. newerfile-Name: if the modification time of file-name on the remote machine is closer than that of a file with the same name on the local hard disk, the file is retransmitted.
38. NLIST [Remote-Dir] [local-file] displays the list of files in the remote host directory and stores the local-file on the local hard disk.
39. NMAP [inpatternoutpattern] sets the file name ing mechanism so that some characters in the file are converted to each other during file transmission, such as NMAP ¥1. ¥2. ¥3 [¥1, ¥2]. [¥2, ¥3], transfer file A1. a2.a3, the file name becomes A1, A2, this command is particularly applicable to the remote host is not a U-NIX machine.
40. ntrans [inchars [outchars] sets the file name character translation mechanism. For example, if ntrans1r is used, the file name lll will be changed to Rrr.
41. Open host [port] To establish a connection to the specified FTP server. You can specify the connection port.
42. Passive enters the passive transmission mode.
43. Prompt sets interaction prompts when multiple files are transferred.
44. In the secondary control connection, proxyftp-cmd executes an FTP command, which 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. put local-file [Remote-file] transfers the local file to the remote host.
46. pwd displays the current working directory of the remote host.
47. Quit and bye quit the FTP session.
48. Quote arg1, arg2 ...... Send the parameter to the remote FTP server, for example, quote syst.
49. Recv remote-file [local-file] is the same as get.
50. regetremote-file [local-file] is similar to get. However, if local-file exists, it will be resumed from the last transmission interruption.
51. rhelp [cmd-name] request for help from the remote host.
52. If the file name is not specified for rstatus, the remote host status is displayed; otherwise, the file status is displayed.
53. RENAME [from] [to] Change the remote host file name.
54. Reset clear answer queue.
55. Restart marker starts get or put again from the specified mark marker, such as restart 130.
56. rmdir Dir-Name: Delete the remote host directory.
57. runique sets the unique storage of file names. If the file exists, a suffix is added after the original file.
58. Send local-file [Remote-file] is the same as put.
59. Use sendport to set the PORT command.
60. Site arg1, arg2 ...... Send the parameter to the remote FTP host as the site command.
61. Size file-Name: displays the file size of the remote host, such as site idle 7200.
62. status shows the current FTP status.
63. struct [struct-name] sets the file transmission structure to struct-name, which saves time and uses the stream structure.
64. sunique sets the remote host file name storage to unique (corresponding to runique ).
65. The system displays the operating system type of the remote host.
66. tenex sets the file transfer type as required by tenex.
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, such as typebinary, and sets the binary transmission mode.
70. umask [newmask] sets the default umask of the remote server to newmask, for example, umask 3.
71. useruser-name [Password] [account] indicates your identity to the remote host. If you need a password, you must enter the password, such as user Anonymous My @ email.
72. verbose is the same as the-V parameter of the command line, that is, the detailed report mode is set. All the responses of the FTP server are displayed to the user. The default value is on.
73 .? [Cmd] Same as help.
Bytes ----------------------------------------------------------------------------------------------------------------
Simple upload and download instance (/*... */For annotation ):
Assume that there is an FTP server, the FTP server: qint.ithot.net, And the username and password: user1234. Create a folder "qint" on the Local Computer D: disk ". Copy the file to D:/qint. Use the FTP command to upload files from the local device. The steps for downloading files from the server are as follows:
1. "Start"-"run"-Enter "ftp"
2. The open qint.ithot.net/* step can be merged with the first step. In "run", enter "FTP qint.ithot.net" directly ". If your FTP server is not using the default port 21, if the port is 2121, then the command in this step should be followed by a space of 2121, that is, "Open qint.ithot.net 2121 "*/
3. Username/* prompts you to enter the user name */
4. user1234/* prompts you to enter the password. If the password is not displayed, enter the password and press Enter. If your password is incorrect, you will not be prompted to re-enter the password. If you want to enter the "user" command, step 3 will appear. You can re-enter the user name and password. */
5. DIR/* after you log on to the FTP server, you can use the Dir command to view the files and directories on the FTP server. You can use the LS command to view only the files. */
6. mkdir qint/* Create a qint directory under the root directory on the FTP server. */
7. Run CD qint/* to enter the directory qint. Use "CD your directory name" to enter the next level directory of the current directory, which is the same as DOS. */
8. bin/* uses binary transmission. If you want to upload and download, this step is very important. If you do not execute this command first, the upload and download will be very slow. */
9. LCD d:/qint/* locates the local default folder. I created it on disk D in advance. */
10 .! DIR/* view files and directories in the local folder */
11. Put i001.jpg/* upload the i001.jpg file in the current directory (D:/qint.pdf) to the default directory on the FTP server. You can use "mput *. *" to upload all files to the FTP server. */
12. Get d123.jpg/* download the file d123.jpg in the ftpserver inventory directory to the current directory (D:/qint ). You can use "mget *. *" to download all files to D:/qint */
13. Delete *. */* Delete all files in the qint directory. */
14. CD ../* return to the upper-level directory, that is, the root directory. Return to the upper-level directory and use "CD ..". Note that there are spaces in the middle. Use "CD/" to return the root directory /". */
15. mrdir qint/* Delete the directory qint. Delete A directory. Files And Directories cannot be deleted. */
16. Bye/* log out of the FTP server */
When uploading and downloading files, pay special attention to the current directory of the server and local computer, where the files are located. View the current directory command of the FTP server as PWD. You can use the CD command to locate the directory of the server. You can use LCD commands to locate the directory of the local computer. The above example applies the most common commands for uploading and downloading via FTP command line. You can also use the command "? "View more commands.