FTP commands are one of the most frequently used commands by Internet users. Whether using FTP in DOS or UNIX operating systems, they will encounter a large number of FTP internal commands. Familiar with and flexibly apply FTP internal commands can greatly facilitate users and achieve twice the result with half the effort. Let’s take the FTP command in the DOS window of Win9x as an example to introduce its usage. (Note to this site: If you want to use FTP commands in pure DOS, you must first load the packet driver of a network device such as a network card or modem, and then use the Wattcp FTP program in the "Network Tools" of this site. The usage is similar to the one described below. For details, please refer to the "DOS Usage" column of this site)
The command line format of FTP is: ftp -v -d -i -n -g [hostname], where
-v Displays all response information of the remote server;
-n Restrict the automatic login of ftp, that is, it is not used;
.n etrc file;
-d Use debugging method;
-g Cancel the global file name.
The internal commands used by FTP are as follows (brackets indicate optional):
1.![cmd[args]: Execute interactive shell in the local machine, exit back to the ftp environment, such as: !ls*.zip
2.$ macro-ame[args]: Execute macro to define macro-name.
[password]: Provides additional passwords required to access system resources after logging into the remote system successfully.
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.
: Use the Ascii type transmission method.
: The computer rings once after each command is executed.
: Use binary file transfer method.
: Exit the ftp session process.
: When using mget, convert uppercase to lowercase letters in the remote host file name.
remote-dir: Enter the remote host directory.
: Enter the parent directory of the remote host directory.
mode file-name: Set the access method of the remote host file file-name to mode, such as: chmod 777 .
: interrupt the ftp session with the remote server (corresponding to open).
: When transferring files using asscii, convert the carriage return line break into a line break.
remote-file: Delete the remote host file.
[debug-value]: Set the debugging method to display each command sent to the remote host, such as: deb up 3. If set to 0, it means canceling debug.
[remote-dir][local-file]: Displays the remote host directory and saves the results to the local file local-file.
: Same as close.
format: Set the file transfer method to format, the default is file method.
remote-file[local-file]: Pass the remote-file file of the remote host to the local hard disk local-file.
: Set the file name extension of mdelete, mget, and mput. The file name is not extended by default, and the same as the -g parameter on the command line.
: Each 1024 bytes are transmitted, a hash symbol (#) is displayed.
[cmd]: Displays the help information of the ftp internal command cmd, such as: help get.
[seconds]: Set the hibernation timer of the remote server to [seconds] seconds.
: Set the binary transmission method (same as binary).
[dir]: Switch the local working directory to dir.
[remote-dir][local-file]: Display the remote directory remote-dir, and store the local file local-file.
macro-name: Define a macro. When an empty line under macdef is encountered, the macro definition ends.
[remote-file]: Delete the remote host file.
remote-files local-file: Similar to dir, but can specify multiple remote files, such as: mdir *.o.*.zipoutfile .
remote-files: Transfer multiple remote files.
dir-name: Create a directory in the remote host.
remote-file local-file: same as nlist, but multiple file names can be specified.
[modename]: Set the file transfer method to modename, the default is stream method.
file-name: Displays the last modification time of the remote host file.
local-file: Transfer multiple files to a remote host.
file-name: If the modification time of file-name in the remote machine is closer than the time of the file with the same name on the local hard disk, the file will be retransmitted.
[remote-dir][local-file]: Displays a list of files in the remote host directory and saves them to the local hard disk local-file.
[inpattern outpattern]: Set the file name mapping mechanism so that when the file is transferred, some characters in the file are converted to each other. For example: nmap $1.$2.$3[$1, $2].[$2, $3], then when the file a1.a2.a3 is transferred, the file name becomes a1, a2. This command is especially suitable for situations where the remote host is a non-UNIX machine.
[inchars[outchars]: Set the translation mechanism of file name characters, such as ntrans1R, and the file name LLL will become RRR.
host[port]: Establish a specified ftp server connection and specify the connection port.
: Enter passive transmission mode.
: Set interactive prompts when multiple files are transferred.
ftp-cmd: In the secondary control connection, execute 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 the two servers.
local-file[remote-file]: Transfer local-file to the remote host.
: Displays the current working directory of the remote host.
: Same as bye, exit the ftp session.
arg1, arg2...: Send parameters literally to the remote ftp server, such as: quote syst.
remote-file[local-file]: same as get.
remote-file[local-file]: Similar to get, but if local-file exists, it will be transferred from the last transmission interruption.
[cmd-name]: Request help from the remote host.
[file-name]: If the file name is not specified, the status of the remote host will be displayed, otherwise the file status will be displayed.
[from][to]: Change the remote host file name.
: Clear the answer queue.
marker: Start get or put again from the specified marker, such as: restart 130.
dir-name: Delete the remote host directory.
: Set the file name unique storage. If the file exists, add the suffix.1, .2, etc. to the original file.
local-file[remote-file]: same as put.
: Set the use of PORT command.
arg1, arg2...: Send parameters verbatim as SITE commands to the remote ftp host.
file-name: Displays the remote host file size, such as: site idle 7200.
: Display the current ftp status.
[struct-name]: Set the file transfer structure to struct-name, and the stream structure is used by default.
: Set the remote host file name storage to unique (corresponding to runique).
: Displays the operating system type of the remote host.
: Set the file transfer type to the desired type of the TENEX machine.
: Set the byte counter during transmission.
: Set up package tracking.
[type-name]: Set the file transfer type to type-name, the default is ascii, such as: type binary, set the binary transmission method.
[newmask]: Set the default umask of the remote server to newmask, such as: umask 3
user-name[password][account]: To indicate your identity to the remote host, you must enter a password when you need a password, such as: user anonymous my@email.
: The -v parameter of the same command line, that is, the detailed reporting method is set, and all responses from the ftp server will be displayed to the user, and the default is on.
73.?[cmd]: same as help.
The command line format of FTP is: ftp -v -d -i -n -g [hostname], where
-v Displays all response information of the remote server;
-n Restrict the automatic login of ftp, that is, it is not used;
.n etrc file;
-d Use debugging method;
-g Cancel the global file name.
The internal commands used by FTP are as follows (brackets indicate optional):
1.![cmd[args]: Execute interactive shell in the local machine, exit back to the ftp environment, such as: !ls*.zip
2.$ macro-ame[args]: Execute macro to define macro-name.
[password]: Provides additional passwords required to access system resources after logging into the remote system successfully.
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.
: Use the Ascii type transmission method.
: The computer rings once after each command is executed.
: Use binary file transfer method.
: Exit the ftp session process.
: When using mget, convert uppercase to lowercase letters in the remote host file name.
remote-dir: Enter the remote host directory.
: Enter the parent directory of the remote host directory.
mode file-name: Set the access method of the remote host file file-name to mode, such as: chmod 777 .
: interrupt the ftp session with the remote server (corresponding to open).
: When transferring files using asscii, convert the carriage return line break into a line break.
remote-file: Delete the remote host file.
[debug-value]: Set the debugging method to display each command sent to the remote host, such as: deb up 3. If set to 0, it means canceling debug.
[remote-dir][local-file]: Displays the remote host directory and saves the results to the local file local-file.
: Same as close.
format: Set the file transfer method to format, the default is file method.
remote-file[local-file]: Pass the remote-file file of the remote host to the local hard disk local-file.
: Set the file name extension of mdelete, mget, and mput. The file name is not extended by default, and the same as the -g parameter on the command line.
: Each 1024 bytes are transmitted, a hash symbol (#) is displayed.
[cmd]: Displays the help information of the ftp internal command cmd, such as: help get.
[seconds]: Set the hibernation timer of the remote server to [seconds] seconds.
: Set the binary transmission method (same as binary).
[dir]: Switch the local working directory to dir.
[remote-dir][local-file]: Display the remote directory remote-dir, and store the local file local-file.
macro-name: Define a macro. When an empty line under macdef is encountered, the macro definition ends.
[remote-file]: Delete the remote host file.
remote-files local-file: Similar to dir, but can specify multiple remote files, such as: mdir *.o.*.zipoutfile .
remote-files: Transfer multiple remote files.
dir-name: Create a directory in the remote host.
remote-file local-file: same as nlist, but multiple file names can be specified.
[modename]: Set the file transfer method to modename, the default is stream method.
file-name: Displays the last modification time of the remote host file.
local-file: Transfer multiple files to a remote host.
file-name: If the modification time of file-name in the remote machine is closer than the time of the file with the same name on the local hard disk, the file will be retransmitted.
[remote-dir][local-file]: Displays a list of files in the remote host directory and saves them to the local hard disk local-file.
[inpattern outpattern]: Set the file name mapping mechanism so that when the file is transferred, some characters in the file are converted to each other. For example: nmap $1.$2.$3[$1, $2].[$2, $3], then when the file a1.a2.a3 is transferred, the file name becomes a1, a2. This command is especially suitable for situations where the remote host is a non-UNIX machine.
[inchars[outchars]: Set the translation mechanism of file name characters, such as ntrans1R, and the file name LLL will become RRR.
host[port]: Establish a specified ftp server connection and specify the connection port.
: Enter passive transmission mode.
: Set interactive prompts when multiple files are transferred.
ftp-cmd: In the secondary control connection, execute 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 the two servers.
local-file[remote-file]: Transfer local-file to the remote host.
: Displays the current working directory of the remote host.
: Same as bye, exit the ftp session.
arg1, arg2...: Send parameters literally to the remote ftp server, such as: quote syst.
remote-file[local-file]: same as get.
remote-file[local-file]: Similar to get, but if local-file exists, it will be transferred from the last transmission interruption.
[cmd-name]: Request help from the remote host.
[file-name]: If the file name is not specified, the status of the remote host will be displayed, otherwise the file status will be displayed.
[from][to]: Change the remote host file name.
: Clear the answer queue.
marker: Start get or put again from the specified marker, such as: restart 130.
dir-name: Delete the remote host directory.
: Set the file name unique storage. If the file exists, add the suffix.1, .2, etc. to the original file.
local-file[remote-file]: same as put.
: Set the use of PORT command.
arg1, arg2...: Send parameters verbatim as SITE commands to the remote ftp host.
file-name: Displays the remote host file size, such as: site idle 7200.
: Display the current ftp status.
[struct-name]: Set the file transfer structure to struct-name, and the stream structure is used by default.
: Set the remote host file name storage to unique (corresponding to runique).
: Displays the operating system type of the remote host.
: Set the file transfer type to the desired type of the TENEX machine.
: Set the byte counter during transmission.
: Set up package tracking.
[type-name]: Set the file transfer type to type-name, the default is ascii, such as: type binary, set the binary transmission method.
[newmask]: Set the default umask of the remote server to newmask, such as: umask 3
user-name[password][account]: To indicate your identity to the remote host, you must enter a password when you need a password, such as: user anonymous my@email.
: The -v parameter of the same command line, that is, the detailed reporting method is set, and all responses from the ftp server will be displayed to the user, and the default is on.
73.?[cmd]: same as help.