Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

The FTP command is explained in detail


May 23, 2021 DOS Command learning manual



FTP command is one of the most frequently used commands by Internet users, familiar with and flexible application of FTP's internal commands, can greatly facilitate the user, and receive more than half the effort. If you want to learn to use background FTP downloads, you must learn the FTP instructions.


The command line format for FTP is:

ftp -v -d -i -n -g (host name), where


-v displays all response information for the remote server;


-n Limit the automatic login of ftp, i.e. do not use;


-d Use debugging;


-g Cancel the global file name.


The internal commands used by FTP are as follows (the parenthesis indicates optional):


1.! T he interaction shell is performed on the local machine, and the exit returns to the ftp environment, such as:!ls*.zip

2.$ macro-ame(args): Execute macro definition macro-name.


3.account(password): Provides the additional password required to access system resources after successfully logging on to the remote system.

4.append local-file: Append a local file to a remote system host and use a local file name if the remote system file name is not specified.


5.ascii: Use ascii type transmission.

6.bell: The computer rings once each command has been executed.


7.bin: Use binary file transfer.

8.bye: Exit the ftp session process.


9.case: When using mget, convert the capital 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 method of the remote host file file-name to mode, e.g. chmod 777 a.out.


13.close: Interrupt the ftp session with the remote server (corresponding to open).

14.cr: When you transfer files using asscii, convert a carriage return line back to a return line.


15.delete remote-file: Delete remote host files.

16.debug(debug-value): Set debugging mode to display each command sent to the remote host, such as: deb up 3, if set to 0, to cancel dugeb.


17.dir (remote-dir) (local-file): displays the remote host directory and deposits the results in a local file.

18.disconnection: with close.


19.form format: Set the file transfer method to format, the default is file mode.

20.get remote-file: Remote-file, the file of the remote host is transmitted to the local hard drive's local-file.


21.glob: Set the file name extension of mdelete, mget, mput, by default without extending the file name, with the command line-g parameter.

22.hash: For every 1024 bytes transmitted, a hash symbol is displayed.


23.help(cmd): Displays help information for the ftp internal command cmd, e.g. help get.

24.idles: Set the sleep timer for the remote server to seconds.


25.image: Set the binary transport mode (same as binary).

26.lcd(dir): Switch the local working directory to dir.


27.ls the remote-dir: display the remote directory remote-dir and deposit it in the local file local-file.

28.macdef macro-name: Define a macro, which ends when an empty line under macdef is encountered.


29.mdelete (remote-file): Delete remote host files.

30.mdir remote-files local-file: similar to dir, but can specify multiple remote files, such as : mdir .o..zipoutfile.


31.mget remote-files: Transfer multiple remote files.

32.mkdir dir-name: Build a directory in a remote host.


33.mls remote-file local-file: same as nlist, but can specify multiple file names.

34.mode (modename): Set the file transfer method to modename, by default to stream mode.


35.modtime file-name: Shows the last time the remote host file was modified.

36.mput local-file: Transfer multiple files to a remote host.


37.newer file-name: If the file-name in the remote machine is modified more recently than the file of the same name on the local hard drive, the file is re-passed.

38.nlist (remote-dir) (local-file): displays a list of files from the remote host directory and deposits them into the local hard drive's local local-file.


39.nmap ( inpattern outpattern) : Set up a file name mapping mechanism, so that when a file is transferred, certain characters in the file are converted to each other, such as: nmap $1.$2.$3 . W hen file a1.a2.a3 is transferred, the file name changes to a1,a2. This command is especially useful in cases when the remote host is a non-UNIX machine.

40.ntrans (inchars) : Set the translation mechanism for file name characters, such as ntrans1R, then the file name LLL will become RRR.


41.open host: Establish a specified ftp server connection, you can specify a connection port.

42.passive: Enter passive transmission.


43.prompt: Set interactive tips for multiple file transfers.

44.proxy ftp-cmd: In a secondary control connection, a ftp command is executed 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: Transfer the local file local-file to the remote host.

46.pwd: Displays the current working directory of the remote host.


47.quit: With bye, exit the ftp session.

48.quote arg1,arg2... : Send parameters word for word to remote ftp servers, e.g. quote syst.


49.recv remote-file (local-file): same get.

50.reget remote-file:local-file: similar to get, but if local-file exists, it is renewed from the last transmission interruption.


51.rhelp (cmd-name): Request help from a 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 sfs to: Change the remote host file name.

54.reset: Clear the answer queue.


55.restart marker: Restart get or put from the specified logo marker, e.g. restart 130.

56.rmdir dir-name: Delete the remote host directory.


57.runique: Set the file name to store only one sex, and if the file exists, add the suffix .1, .2, etc. after the original file.

58.send local-file(remote-file): same put.


59.sendport: Set the use of the PORT command.

60.site arg1,arg2... : Send parameters verbat from the SITE command to the remote ftp host.


61.size file-name: Displays remote host file size, e.g. site idle 7200.

62.status: Shows the current ftp status.


63.struct-name: Set the file transfer structure to struct-name, using the stream structure by default.

64.sunique: Set the remote host file name store 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 type required for the TENEX machine.


67.tick: Set the byte counter at the time of transmission.

68.trace: Set up package tracking.


69.type-name: Set the file transfer type to type-name, default to ascii, e.g. type binary, set the binary transfer mode.

70.umask: Set the default umask for the remote server to newmask, e.g. umask 3


71.user-name(password): To identify yourself as a remote host, you must enter a password when you need a password, such as user anonymous my@email.

72.verbose: The same command line-v parameter, that is, set the detailed reporting method, ftp server all sound should be displayed to the user, the default is on.


73.? (cmd): with help.