The meaning of ftp -n -s:test.txt is: the commands you need to type in ftp are placed in a script file, named test.txt.
The parameter -s: means that the following is the specified script command file with automatic commands.
For more detailed information, you can look at its help. You can view the help information by FTP --help, while FTP /? will not show the help.
The acquisition of help information by FTP --HELP, this --HELP instead of /? comes from the Linux style, and the usage is the same there.
C:\windows\system32>ftp --help
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.
FTP
-v Suppresses display of remote server responses.
-n Suppresses auto-login upon initial connection.
-i Turns off interactive prompting during multiple file
transfers.
-d Enables debugging.
-g Disables filename globbing (see GLOB command).
-s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.
-a Use any local interface when binding data connection.
-A login as anonymous.
-x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
-r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
-b:async count Overrides the default async count of 3
-w:buffer size Overrides the default transfer buffer size of 65535.
host Specifies the host name or IP address of the remote
host to connect to.
Notes:
- mget and mput commands take y/n/q for yes/no/quit.
- Use Control-C to abort commands.
Since FTP will call the automatic command script file specified by you through the -s: parameter as soon as it runs,
then this test.txt must be in the current directory.
Why the content of test.txt is like this:
o 127.0.0.1 21
user admin
pass
put D:\1234\*.*
exit
Because if you directly enter FTP, you also need to tell it which server you want to connect to first?
So the command is:
open the server address you want to connect to 21
This 21 is the port number of the server you want to specify for connection (it is generally 21 by default, if it is not 21, it is generally for special reasons such as preventing hacker scanning...).
Then the service is connected,
naturally you need to enter the login name and password,
so, if you operate in FTP yourself, remember what commands you have used,
you can write a command set for this "answer" command to execute automatically, put it in a text file,
and then operate as in the example principle of he200377.
Enter FTP, if you type?, you can also get more detailed command help.
As for which operation commands are placed in your automatic response instruction file (test.txt),
you need to first use ftp to perform all the work operations you need,
so you will know what the system will ask you, and then what content you need to enter (this input is what should be put into the automatic instruction set file).
[
Last edited by redtek on 2006-10-31 at 10:24 AM ]