FTP Command

  

The FTP command is one of the most frequently used commands for Internet users. It is familiar and flexible to apply FTP internal commands, which can greatly facilitate users and get twice the result with half the effort. If you want to learn to use the background FTP download, you must learn FTP commands.

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 restricts automatic login of ftp, ie no Use ;.n etrc file; -d use debug mode; -g cancel global file name.

The internal commands used by FTP are as follows (the brackets indicate optional): 1.![cmd[args]]: Execute the interactive shell in the local machine, exit returns to the ftp environment, such as: !ls*. Zip2.$ macro-ame[args]: Execute the macro definition macro-name. 3.account[password]: Provides the supplemental password required to access system resources after logging in to 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 of transmission. 6.bell: The computer rings once after each command is executed. 7.bin: Use binary file transfer. 8.bye: Exit the ftp session process. 9.case: When using mget, convert the uppercase in the remote host file name to lowercase. 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, for example: chmod 777 a.out. 13.close: Interrupt the ftp session with the remote server (corresponding to open). 14.cr: When using the asscii method to transfer files, the carriage return line feed is converted to a return line. 15.delete remote-file: Delete the remote host file. 16.debug[debug-value]: Set the debug mode to display each command sent to the remote host, such as: deb up 3, if set to 0, cancel the debug. 17.dir[remote-dir][local-file]: Display the remote host directory and save the result to a 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 remote host's file remote-file to the local-file of the local hard disk. 21.glob: Set the file name extension of mdelete, mget, mput. By default, the file name is not extended. The -g parameter of the command line? 22.hash: Each time 1024 bytes are transmitted, a hash symbol (#) is displayed. 23.help[cmd]: Display 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 transfer 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: Defines a macro that ends when a blank line under macdef is encountered. 29.mdelete[remote-file]: Delete the remote host file. 30.mdir remote-files local-file: Similar to dir, but you can specify multiple remote files, 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 a remote host. 37.newer file-name: If the modification time of the file-name in the remote machine is missing the mirror, then the 募 募 氖 涓 蛑卮 蛑卮 梦 梦 梦 梦 梦 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 ,null,null,3],Local-file]: Displays a list of files in the remote host directory and stores them in the local-file of the local hard disk. 39.nmap[inpattern outpattern]: Sets the file name mapping mechanism so that some characters in the file are converted to each other when the file is transferred, such as nmap $1.$2.$3[$1,$2].[$2,$3], then transfer When the file a1.a2.a3, the file name becomes a1, a2. This command is especially useful when the remote host is a non-UNIX machine.

40.ntrans[inchars[outchars]]: Set the translation mechanism of the file name characters, such as ntrans1R, the file name LLL will become RRR. 41.open host[port]: Establish a specified ftp server connection, you can specify the connection port. 42.passive: Enter passive transmission mode. 43.prompt: Set interactive prompts when multiple files are transferred. 44.proxy ftp-cmd: In the secondary control connection, execute an ftp command that allows two ftp servers to be connected to transfer files between the two servers. The first ftp command must be open to establish a connection between the two servers first. 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 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, it will resume from the last transmission interruption. 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 the get or put from the specified flag marker, such as: restart 130. 56.rmdir dir-name: delete the remote host directory. 57.runique: Set the file name to be stored only once. If the file exists, add the suffix .1, .2, etc. after the original file. 58.send local-file[remote-file]: Same as put. 59.sendport: Set the use of the PORT command. 60.site arg1, arg2...: Send parameters as a SITE command verbatim to the remote ftp host. 61.size file-name: Displays the size of the remote host file, such as: site idle 7200. 62.status: Displays the current ftp status. 63.struct[struct-name]: Sets the file transfer structure to struct-name, which by default uses the stream structure. 64.sunique: Set the remote host file name storage to only one (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 when transmitting. 68.trace: Set packet tracking. 69.type[type-name]: Set the file transfer type to type-name, the default is ascii, such as: type binary, set the binary transfer mode.


70.umask[newmask]: Set the default umask of the remote server to newmask, for example: umask 3 71.user user-name[password][account]: indicate your identity to the remote host, you need For passwords, you must enter a password, such as: user anonymous my@email. 72.verbose: Same as the -v parameter of the command line, that is, the detailed report mode is set. All responses of the ftp server will be displayed to the user. The default is on. 73.?[cmd]: Same as help.



Copyright © Windows knowledge All Rights Reserved