Familiar with FTP commands
Author:Eve Cole
Update Time:2009-05-30 23:20:51
The FTP command is one of the most frequently used commands by Internet users. Whether you use FTP under DOS or UNIX operating systems, you will encounter a large number of FTP internal commands. Being familiar with and flexibly applying FTP's 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 response information from the remote server;
-n restricts the automatic login of ftp, that is, does not use it;
-i etrc file;
-d Use debugging mode;
-g Suppresses global file names.
The internal commands used by ftp are as follows (square brackets indicate optional options):
1.![cmd[args]]: Execute an interactive shell on the local machine, exit back to the ftp environment, such as: !ls*.zip.
2.$ macro-ame[args]: Execute macro definition macro-name.
3.account[password]: Provide the supplementary password required to access system resources after successfully logging into the remote system.
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 type transmission method.
6.bell: The computer rings once after each command is executed.
7.bin: Use binary file transfer method.
8.bye: Exit the ftp session process.
9.case: When using mget, convert uppercase letters in the remote host file name to lowercase letters.
10.cd remote-dir: Enter the remote host directory.
11.cdup: Enter the parent directory of the remote host directory.
12.chmod mode file-name: Set the access mode of the remote host file file-name to mode, such as: chmod 777 a.out.
13.close: Interrupt the ftp session with the remote server (corresponding to open).
14.cr: When using ASCII to transfer files, convert carriage returns and line feeds into line returns.
15.delete remote-file: Delete the remote host file.
16.debug[debug-value]: Set the debugging mode to display each command sent to the remote host, such as: deb up 3. If set to 0, it means canceling debugging.
17.dir[remote-dir][local-file]: Display the remote host directory and store the results in the local file local-file.
18.disconnection: same as close.
19.form format: Set the file transfer mode to format, the default is file mode.
20.get remote-file[local-file]: Transfer the file remote-file of the remote host to the local-file of the local hard disk.
21.glob: Set the file name expansion of mdelete, mget, and mput. By default, the file name is not expanded, which is the same as the -g parameter on the command line.
22.hash: Every time 1024 bytes are transmitted, a hash symbol (#) is displayed.
23.help[cmd]: Displays help information for the ftp internal command cmd, such as: help get.
24.idle[seconds]: Set the remote server's sleep timer to [seconds] seconds.
25.image: Set the binary transmission mode (same as binary).
26.lcd[dir]: Switch the local working directory to dir.
27.ls[remote-dir][local-file]: Display the remote directory remote-dir and save it to the local file local-file.
28. macdef macro-name: Define a macro. When encountering a blank line under macdef, the macro definition ends.
29.mdelete[remote-file]: Delete the remote host file.
30.mdir remote-files local-file: Similar to dir, but multiple remote files can be specified, such as: mdir *.o.*.zipoutfile
31.mget remote-files: Transfer multiple remote files.
32.mkdir dir-name: Create a directory in the remote host.
33.mls remote-file local-file: Same as nlist, but multiple file names can be specified.
34.mode[modename]: Set the file transfer mode to modename, the default is stream mode.
35.modtime file-name: Displays the last modification time of the remote host file.
36.mput local-file: Transfer multiple files to the remote host.
37.newer 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.
38.nlist[remote-dir][local-file]: Displays the file list of the remote host directory and stores it in the local-file of the local hard disk.
39.nmap[inpattern outpattern]: Set the file name mapping mechanism so that certain characters in the file are converted to each other when transferring files, such as: nmap $1.$2.$3[$1, $2].[$2, $3], then transfer When the file is a1.a2.a3, the file name becomes a1, a2. This command is particularly suitable for situations where the remote host is a non-UNIX machine.
40.ntrans[inchars[outchars]]: Set the translation mechanism of file name characters, such as ntrans 1R, then the file name LLL will become RRR.
41.open host[port]: Establish a connection to the specified ftp server, and the connection port can be specified.
42.passive: Enter passive transmission mode.
43.prompt: Set interactive prompts when transferring multiple files.
44.proxy 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.
45.put local-file[remote-file]: Transfer the local file local-file to the remote host.
46.pwd: Displays the current working directory of the remote host.
47.quit: Same as bye, exit the ftp session.
48.quote arg1, arg2...: Send the parameters verbatim to the remote ftp server, such as: quote syst.
49.recv remote-file[local-file]: Same as get.
50.reget remote-file[local-file]: similar to get, but if local-file exists, the transmission will be resumed from the point where the last transmission was interrupted.
51.rhelp[cmd-name]: Request help from the remote host.
52.rstatus[file-name]: If the file name is not specified, the status of the remote host 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.restart marker: Restart get or put from the specified marker, such as: restart 130.
56.rmdir dir-name: Delete the remote host directory.
57.runique: Set the unique storage of the file name. If the file exists, add the suffix ..1, .2, etc. to the original file.
58.send local-file[remote-file]: Same as put.
59.sendport: Set the use of PORT command.
60.site arg1, arg2...: Send the parameters verbatim to the remote ftp host as a SITE command.
61.size file-name: Displays the remote host file size, such as: site idle 7200.
62.status: displays the current ftp status.
63.struct[struct-name]: Set the file transfer structure to struct-name. By default, the stream structure is used.
64.sunique: Set the remote host file name storage to be unique (corresponding to runique).
65.system: Displays the operating system type of the remote host.
66.tenex: Set the file transfer type to the desired type of TENEX machine.
67.tick: Set the byte counter during transmission.
68.trace: Set up packet tracking.
69.type[type-name]: Set the file transmission type to type-name, the default is ascii, such as: type binary, set the binary transmission mode.
70.umask[newmask]: Set the default umask of the remote server to newmask, such as: umask 3.
71.user user-name[password][account]: Indicate your identity to the remote host. When a password is required, you must enter the password, such as: user anonymous my@email.
72.verbose: Same as the -v parameter on the command line, that is, setting the detailed reporting mode. All responses from the ftp server will be displayed to the user. The default is on.
73.?[cmd]: Same as help.