Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Basic usage of the FTP command

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "the basic use of the FTP command". In the daily operation, I believe many people have doubts about the basic use of the FTP command. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about the basic use of the FTP command. Next, please follow the editor to study!

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 automatic login of ftp, that is, do not use the

.n etrc file

-d use debug mode

-g cancels the global file name.

The internal commands used by FTP are as follows (square brackets indicate optional):

1! [cmd [ARGs]: perform an interactive shell,exit on the local machine to return to the ftp environment, such as:! ls*.zip

2.$ macro-ame [args]: executes the macro definition macro-name.

3.account [password]: provides the supplementary password required to access system resources after a successful login to the remote system.

4.append local-file [remote-file]: appends local files to the remote system host, or uses the local file name if the remote system file name is not specified.

5.ascii: use ascii type transport.

6.bell: the computer rings once after each command is executed.

7.bin: use binary file transfer.

8.bye: exits the ftp session process.

9.case: when using mget, change the uppercase to lowercase letters in the remote host file name.

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: interrupts the ftp session with the remote server (corresponding to open).

14.cr: when transferring files in asscii mode, enter newline is converted to return line.

15.delete remote-file: delete the remote host file.

16.debug [debug-value]: sets the debug mode to display every command sent to the remote host, such as deb up 3. Setting it to 0 means canceling debug.

17.dir [remote-dir] [local-file]: displays the remote host directory and stores the results in the local file local-file.

18.disconnection: same as close.

19.form format: sets the file transfer mode to format and defaults to 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: sets the filename extension for mdelete,mget,mput. By default, the filename is not extended, same as the-g argument on the command line.

22.hash: displays a hash symbol (#) for every 1024 bytes transferred.

23.help [cmd]: displays help information for the ftp internal command cmd, such as help get.

24.idle [seconds]: sets the sleep timer of the remote server to [seconds] seconds.

25.image: sets the binary transfer mode (same as binary).

26.lcd [dir]: change the local working directory to dir.

27.ls [remote-dir] [local-file]: displays the remote directory remote-dir and saves it to the local file local-file.

28.macdef macro-name: define a macro that ends when a blank line under macdef is encountered.

29.mdelete [remote-file]: deletes the remote host file.

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: create a directory on the remote host.

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

34.mode [modename]: sets the file transfer mode to modename and defaults to 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 on the remote machine is closer than that of the file with the same name on the local hard disk, retransmit the file.

38.nlist [remote-dir] [local-file]: displays the file list of the remote host directory and saves it to the local-file of the local hard disk.

39.nmap [inpattern outpattern]: set the file name mapping mechanism, so that when a file is transferred, some characters in the file are converted to each other, such as: nmap $1.account2.account3 [$1jijin2]. [$2memename 3], then when transferring the file a1.a2.a3, the filename becomes a1jina2. This command is especially suitable for situations where the remote host is a non-UNIX machine.

40. N transfer [outchars]: set the translation mechanism of file name characters, such as ntrans1R, then the file name LLL will become RRR.

41.open host [port]: a specified ftp server connection is established, and the connection port can be specified.

42.passive: enter the passive transmission mode.

43.prompt: sets interactive prompts for multiple file transfers.

44.proxy ftp-cmd: in a secondary control connection, execute a 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 first establish a connection between the two servers.

45.put local-file [remote-file]: transfers the local file local-file to a 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...: sends 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 is resumed from the last transmission interruption.

51.rhelp [cmd-name]: request help from a remote host.

52.rstatus [file-name]: if no file name is specified, the status of the remote host is displayed, otherwise the file status is displayed.

53.rename [from] [to]: change the file name of the remote host.

54.reset: clears the answer queue.

55.restart marker: restart 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 unique storage of the file name. If the file exists, add the suffix. 1. 2 after the original file, etc.

58.send local-file [remote-file]: same as put.

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

60.site arg1,arg2...: sends parameters verbatim to the remote ftp host as SITE commands.

61.size file-name: displays the file size of the remote host, such as site idle 7200.

62.status: displays the current ftp status.

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

64.sunique: sets the remote host file name store to 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 the TENEX machine.

67.tick: sets the byte counter for transfer.

68.trace: set up package tracking.

69.type [type-name]: sets the file transfer type to type-name, defaults to ascii, such as type binary, and sets the binary transfer 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 you need a password, you must enter a password, such as user anonymous my@email.

72.verbose: with the-v parameter of 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.

At this point, the study of "the basic use of the FTP command" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report