Batch FTP command line

Source: Internet
Author: User
Tags ftp commands remote ftp server runique

Recently, cc.net has studied how to place the generated publishing files on the FTP server as needed, so we have studied this information for sharing with friends:

1. FTP upload command:

Format: ftp-S: [configuration file] [FTP address]

For example, ftp-S: C: \ Vc \ ftpconfig.txt 211.155.224.210

The content of the ftpconfig.txt file is:

Username

PWD

Send test.rar

Quit

The first two commands are fixed, including the user name and password.

Send test.rar send test.rar to the server

Quit exit

2,FTP command line Reference

FTP commands are one of the most frequently used commands by Internet users. A large number of internal FTP commands are used in both dos and 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 command line format of FTP is: ftp-v-d-I-n-g [host name], where
-V: displays all the response information of the remote server;
-I restrict FTP automatic logon, that is, it is not used;
-Netrc file;
-D. Use the debugging method;
-G cancels the global file name.
The internal commands used by FTP are as follows (brackets indicate optional ):
1 .! [Cmd [ARGs]: Execute the interactive shell on the local machine and exit to return to the FTP environment, for example :! Ls *. Zip.
2. $ macro-Ame [ARGs]: Execute the macro to define macro-name.
3. Account [Password]: Provide the supplemental Password required to access system resources after logging on to the remote system.
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: Use the ASCII type transmission method.
6. Bell: after each command is executed, the computer rings once.
7. Bin: Binary File Transfer Mode.
8. Bye: exit the FTP session.
9. Case: when using mget, convert uppercase letters in the remote host 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: Set the file-name access mode of the remote host 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 asscii, the carriage return line is converted into a return line.
15. deleteremote-file: Delete the remote host file.
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 saves the result to the local file.
18. Disconnection: Same as close.
19. formformat: 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: Set the extension of the mdelete, mget, and mput file names, which is the same as the-G parameter in 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]: Set 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-file.
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 Dir, but multiple remote files can be specified, such as mdir *. O. *. zipoutfile.
31. mgetremote-Files: Transfers multiple remote files.
32. mkdirdir-Name: create a directory on the remote host.
33. mlsremote-filelocal-file: 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: displays 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 closer than that of files 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, for example, NMAP $1. $2. $3 [$1, $2]. [$2, $3], transfer the file a1.a2. when A3, the file name is changed to a1, a2. This command is especially applicable when the remote host is not a unix host.
40. ntrans [inchars [outchars]: sets the file name character translation mechanism, for example, ntrans1r, then the file name lll will change to Rrr.
41. openhost [port]: Specifies the FTP server connection. You can specify the connection port.
42. Passive: enters the passive transmission mode.
43. Prompt: Set interaction prompts when multiple files are transferred.
44. proxyftp-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. pwd: displays the current working directory of the remote host.
47. Quit: Same as bye, quit the FTP session.
48. quotearg1, arg2. ..: Send the parameter to the remote FTP server, for example, quotesyst.
49. recvremote-file [local-file]: Same as get.
50. regetremote-file [local-file]: similar to get, but if the local-file exists, it will be resumed from the last transmission interruption.
51. rhelp [cmd-name]: request for 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.
54. Reset: Clear the answer queue.
55. restartmarker: Start get or put again from the specified mark marker, for example, restart130.
56. rmdirdir-Name: Delete the remote host directory.
57. runique: Set the unique storage of file names.
58. sendlocal-file [Remote-file]: Same as put.
59. sendport: Set the PORT command.
60. sitearg1, arg2. ..: Send the parameter to the remote FTP host as the site command.
61. sizefile-Name: displays the file size of the remote host, for example, siteidle7200.
62. Status: 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. sunique: Set the remote host file name storage to unique (corresponding to runique ).
65. System: displays the operating system type of the remote host.
66. tenex: Set 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. Sets the binary transfer mode.
70. umask [newmask]: Set the default umask of the remote server to newmask, for example, umask3.
71. useruser-name [Password] [account]: indicates your identity to the remote host. If you need a password, enter the password, for example, anyone @ email.
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 are displayed to the user. The default value is on.
73 .? [Cmd]: Same as help.

The above is a batch processing operation of FTP, and the package is still in batch processing, put it in the next article, tired ..

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.