Linux FTP command and linuxftp command

Source: Internet
Author: User
Tags glob runique

Linux FTP command and linuxftp command

I,FtpOfGetCommandAnd mgetCommandWhat's the difference?

GetOnly one file is downloaded at a time. mget can download multiple files at a time, and supports wildcards. Note that when mget is used, you must select y/n for each file, if you want to download all files without interaction, you can use promptCommandTurn off the interaction mode (close: prompt off; open: prompt on ).

II,FTPWhat to useCommandTo locate the path between the server and the local hard disk?

FtpUse LCD to switch the local path and cd to switch the remote server path. Commonly usedCommandAs follows:

Cd directory name (enter the Server Directory) LCD directory name (enter the local directory)

Cd \ (return to the root directory of the server) LCD \ (return to the root directory of the local machine)

Cd .. (returned to the upper-level directory) LCD .. (returned to the upper-level directory)

3 ,!CommandWhat is the function?

Execute local shellCommandSuch :! Dir (display local directory content), if not added! For example, dir (display the current directory of the server)

IV,FtpCommandDoes the folder/file name contain spaces?

Yes. You only need to add the double quotation mark "" When referencing it!

5. below isCommandRow-based usageFTPPractical exercises

Assume thatFtpServer:Ftp.Test.com, username, password: user1234. Create a folder "qint" on the Local Computer D: disk ". Copy the file to D: \ qint. PassFTPCommandTo upload a file locally, follow these steps:

1. "Start" → "run" → enter"FTP"

2. openFtp.Test.com

Note: This step can be combined with the first step. In "run", enter:Ftp Ftp.Test.com. If yourFTPThe server does not use the default port 21. If the port is 2121CommandAdd 2121 to the backspace, that is, "open ".Ftp.Test.com

3. username
Note: You are prompted to enter the user name

4. user1234
Note: You are prompted to enter the password. If the password is not displayed, press Enter. If your password is incorrect, you will not be prompted to re-enter it. In this case, you need to enter "user"CommandStep 3 appears. You can enter the user name and password again.

5. dir
Note: You can use dir to view the information after successful login.CommandViewFTPFiles and directories on the server, using lsCommandYou can only view files.

6. mkdir qint
Note: InFTPCreate a qint directory under the root directory on the server

7. cd qint
Note: Go to the directory qint and use "cd your directory name" to enter the next level directory of the current directory, which is the same as DOS.

8. bin

Note: binary transmission is used. This step is important if you want to upload and download data.Command. Most systems (including UNIX systems) have only two modes: text mode and binary mode. The text transmitter uses ASCII characters separated by the carriage return key and line break, while binary can be transferred without conversion or formatting. The binary mode is faster than the text mode and can transmit all ASCII values, therefore, the system administrator usuallyFTPSet to binary mode. In general, we 'd better use the binary method to avoid errors.

9. LCD d: \ qint

Note: locate the local default folder, which has been created on D: disk in advance.

10 ,! Dir

Note: view the files and directories in the local folder.

11. put i001.jpg
Note: Upload the i001.jpg file in the current directory (d: \ qint.pdf)FTPDefault Server Directory. You can use "mput *. *" to upload all filesFTPServer.

12,GetD123.jpg
Note:FTPDownload the d123.jpg file in the server catalog to the current directory (d: \ qint ). You can use "mget *. *" to download all files to d: \ qint.

13. delete *.*

Note: delete all files in the qint directory of the server.

14. cd ..

Note: Return to the upper-level directory, that is, the root directory. Return to the upper-level directory and use "cd...". Note that there are spaces in the middle. Use "cd \" to return the root directory \".

15. mrdir qint

Note: delete the directory qint. Delete A directory. Files And Directories cannot be deleted.

16. bye

Note: ExitFTPServer.

When uploading and downloading files, pay special attention to the current directory of the server and local computer, where the files are located. ViewFTPCurrent Directory of the serverCommandFor pwd, cd can be usedCommandLocate the server directory. LCD availableCommandLocate the directory of the local computer.

The above instances are usedFTPCommandRow-based upload/downloadCommandYou can also useCommand"?" View MoreCommand.

 

FTPCommandIs the most frequently used by Internet usersCommandEither inDOSOr UNIX OSLowerUseFTP, Will encounter a lotFTPInternalCommand. Familiar with and flexible applicationFTPInternalCommandTo greatly facilitate users and get twice the result with half the effort.
FTPOfCommandThe row format is:Ftp-V-d-I-n-g [host name], where
-V: displays all the response information of the remote server;
-N LimitFtpIs not used;
. N etrc file;
-D. Use the debugging method;
-G cancels the global file name.
FtpInternal useCommandFor exampleLower(Brackets indicate optional values ):
1 .! [Cmd [args]: Execute the interactive shell on the local machine and returnFtpEnvironment, such :! Ls *. zip.
2. $ macro-ame [args]: Execute macro to define macro-name.
3. account [password]: Provide the supplemental password required to access system resources after logging on 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 transmission method.
6. bell: eachCommandAfter the task is completed, the computer rings once.
7. bin: Binary File Transfer Mode.
8. bye: ExitFtpSession 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 file-name access mode of the remote host file to mode, for example, chmod 777 a. out.
13. close: disconnected from the remote serverFtpSession (corresponds to open ).
14. cr: When a file is transmitted using asscii, the carriage return line is converted into a return line.
15. delete remote-file: delete remote host files.
16. debug [debug-value]: sets the debugging mode to display each entry sent to the remote host.CommandFor example, deb up 3. If it is set to 0, the debug is canceled.
17. dir [remote-dir] [local-file]: displays the remote host directory and saves the result to the local file.
18. disconnection: Same as close.
19. form format: sets the file transmission mode to format. The default mode is file.
20.GetRemote-file [local-file]: transfers the remote-file of the remote host to the local-file of the local hard disk.
21. glob: Set file name extension for mdelete, mget, and mput. The file name is not extended due to lack of time.CommandThe-g parameter of the row.
22. hash: A hash symbol (#) is displayed for every 1024 bytes transferred (#).
23. help [cmd]: DisplayFtpInternalCommandCmd help information, such as: helpGet.
24. idle [seconds]: Set the Sleep timer of the remote server to [seconds] seconds.
25. image: sets the binary transmission mode (the same as binary ).
26. LCD [dir]: Switch the local working directory to dir.
27. ls [remote-dir] [local-file]: displays the remote Directory remote-dir and stores the local-file.
28. macdef macro-name: defines a macro and encounters macdefLowerThe macro definition ends.
29. mdelete [remote-file]: delete remote host files.
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: Transfers 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 transmission mode to modename. The default mode is stream.
35. modtime file-name: displays the last modification time of the remote host file.
36. mput local-file: Transfers multiple files to the remote host.
37. newer file-name: if the modification time of file-name on the remote machine is closer than that of files with the same name on the local hard disk, the file will be re-transmitted.
38. nlist [remote-dir] [local-file]: displays the list of files in the remote host directory and stores the local-file on the local hard disk.
39. nmap [inpattern outpattern]: sets the file name ing mechanism so that some characters in the file are converted to each other during file transmission, such as nmap $1. $2. $3 [$1, $2]. [$2, $3], transfer the file a1.a2. when a3, the file name is changed to a1, a2. TheCommandIt is particularly applicable when the remote host is not a UNIX host.
40. ntrans [inchars [outchars]: sets the file name character translation mechanism, for example, ntrans 1R, then the file name LLL will change to RRR.
41. open host [port]: Create a specifiedFtpServer connection. You can specify the connection port.
42. passive: enters the passive transmission mode.
43. prompt: Set interaction prompts when multiple files are transferred.
44. proxyFtp-Cmd: In the secondary control connection, executeFtpCommand,CommandAllow two connectionsFtpServer to transfer files between two servers. Article 1FtpCommandIt must be open to first establish a connection between two servers.
45. put local-file [remote-file]: transfers the local-file to the remote host.
46. pwd: displays the current working directory of the remote host.
47. quit: Same as bye, quitFtpSession.
48. quote arg1, arg2. ..: Send the parameter to the remoteFtpServer, such as quote syst.
49. recv remote-file [local-file]: SameGet.
50. reget remote-file [local-file]: similarGetBut if the local-file exists, the data will be resumed from the last transmission interruption.
51. rhelp [cmd-name]: request for help from the remote host.
52. rstatus [file-name]: If no file name is specified, the remote host status 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: Start from the specified mark marker againGetOr put, such as restart 130.
56. rmdir dir-name: Delete the remote host directory.
57. runique: Set the unique storage of file names. If the file exists, add the suffix... 1 and. 2 after the original file.
58. send local-file [remote-file]: Same as put.
59. sendport: Set PORTCommand.
60. site arg1, arg2. .. use the parameter as the SITECommandSend to remoteFtpHost.
61. size file-name: displays the file size of the remote host, for example, site idle 7200.
62. status: displays the currentFtpStatus.
63. struct [struct-name]: sets the file transmission structure to struct-name, and uses the stream structure due to lack of time.
64. sunique: Set the remote host file name storage 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 required type of the TENEX server.
67. tick: sets the byte counter during transmission.
68. trace: Set package tracing.
69. type [type-name]: sets the file transfer type to type-name. The default value is ascii, for example, type binary. Sets the binary transfer mode.
70. umask [newmask]: Set the default umask of the remote server to newmask, for example, umask 3.
71. user-name [password] [account]: indicates your identity to the remote host. If you need a password, enter the password, for example, user anonymous my @ email.
72. verbose: SameCommandThe-v parameter of the row, that is, the detailed report method is set,FtpAll responses from the server are displayed to the user. The default value is on.
73 .? [Cmd]: Same as help.

HypothesisFTPThe address is 61.129.83.39.FTPTry again. You may need to change the password .)
1: "Start"-"run"-Enter"FTP"Go to the cmd interface.
2. open 61.129.83.39
If yourFTPThe server does not use the default port 21. If the port is 9900CommandAdd 9900 to the following space, that is, open 61.129.83.39 9900
3: It prompts you to enter the username
4: it will prompt you to enter the password: password
Note that the password is not displayed. Press enter after the password is closed. If your password is incorrectly entered, you will not be prompted to re-enter the password"CommandYou can enter the user name and password again.
5: You can use dir to view the logs after successful logon.CommandViewFTPFiles and directories on the server, using lsCommandYou can only view files.
6. Use cdCommandDirectory conversion, delete files, usage andDOSSimilar. Haha !!
7: LCD d: dianying location local default folder (I understand L here is the abbreviation of local English, it is easy to understand and remember)
8:LowerSurface is the upload andLowerFileCommandThe put file name is used for uploading.LowerCarrierGetFile Name
Of courseLowerThe directory is defined as "d: dianying"
9: Finally, exit.
Use byeCommand.
Ftp[-V] [-d] [-I] [-n] [-g] [-s: FileName] [-a] [-w: windowSize] [-A] [Host]

Parameters
-V
Disable displayFTPServer Response.
/D
Enable debugging and display onFTPClient andFTPAllCommand.
-I
Disable the interaction prompt when multiple files are transferred.
-N
Disable Automatic logon after the initial connection is established.
-G
Disable file name combination. Glob allows the use of asterisks (*) and question marks (?) As a local file and path name
.
-S: filename
Specify includeFtp Command. TheseCommandStartFtpAnd then run automatically. This parameter is not
Spaces are allowed. Use this parameter instead of redirection (<).
-
Specify bindingFTPAny local interface can be used for data connection.
-W: windowsize
Specifies the size of the transmission buffer. The window size is 4096 bytes by default.
-
Anonymous loginFTPServer.
Host
Specifies the name, IP address, orFTPThe IPv6 address of the server. If the master
The host name or address must beCommandThe last parameter of the row.
/?
InCommandPromptLowerShow Help.
CommonCommand:
1. open:FtpThe server is connected;
2. send (put): upload a file;
3.Get:LowerLoad files;
4. mget:LowerLoad multiple files;
5. cd: Switch the directory, and add the Directory and the complete path.

I,FtpOfGetCommandAnd mgetCommandWhat's the difference?

GetOnly one file is downloaded at a time. mget can download multiple files at a time, and supports wildcards. Note that when mget is used, you must select y/n for each file, if you want to download all files without interaction, you can use promptCommandTurn off the interaction mode (close: prompt off; open: prompt on ).

II,FTPWhat to useCommandTo locate the path between the server and the local hard disk?

FtpUse LCD to switch the local path and cd to switch the remote server path. Commonly usedCommandAs follows:

Cd directory name (enter the Server Directory) LCD directory name (enter the local directory)

Cd \ (return to the root directory of the server) LCD \ (return to the root directory of the local machine)

Cd .. (returned to the upper-level directory) LCD .. (returned to the upper-level directory)

3 ,!CommandWhat is the function?

Execute local shellCommandSuch :! Dir (display local directory content), if not added! For example, dir (display the current directory of the server)

IV,FtpCommandDoes the folder/file name contain spaces?

Yes. You only need to add the double quotation mark "" When referencing it!

5. below isCommandRow-based usageFTPPractical exercises

Assume thatFtpServer:Ftp.Test.com, username, password: user1234. Create a folder "qint" on the Local Computer D: disk ". Copy the file to D: \ qint. PassFTPCommandTo upload a file locally, follow these steps:

1. "Start" → "run" → enter"FTP"

2. openFtp.Test.com

Note: This step can be combined with the first step. In "run", enter:Ftp Ftp.Test.com. If yourFTPThe server does not use the default port 21. If the port is 2121CommandAdd 2121 to the backspace, that is, "open ".Ftp.Test.com

3. username
Note: You are prompted to enter the user name

4. user1234
Note: You are prompted to enter the password. If the password is not displayed, press Enter. If your password is incorrect, you will not be prompted to re-enter it. In this case, you need to enter "user"CommandStep 3 appears. You can enter the user name and password again.

5. dir
Note: You can use dir to view the information after successful login.CommandViewFTPFiles and directories on the server, using lsCommandYou can only view files.

6. mkdir qint
Note: InFTPCreate a qint directory under the root directory on the server

7. cd qint
Note: Go to the directory qint and use "cd your directory name" to enter the next level directory of the current directory, which is the same as DOS.

8. bin

Note: binary transmission is used. This step is important if you want to upload and download data.Command. Most systems (including UNIX systems) have only two modes: text mode and binary mode. The text transmitter uses ASCII characters separated by the carriage return key and line break, while binary can be transferred without conversion or formatting. The binary mode is faster than the text mode and can transmit all ASCII values, therefore, the system administrator usuallyFTPSet to binary mode. In general, we 'd better use the binary method to avoid errors.

9. LCD d: \ qint

Note: locate the local default folder, which has been created on D: disk in advance.

10 ,! Dir

Note: view the files and directories in the local folder.

11. put i001.jpg
Note: Upload the i001.jpg file in the current directory (d: \ qint.pdf)FTPDefault Server Directory. You can use "mput *. *" to upload all filesFTPServer.

12,GetD123.jpg
Note:FTPDownload the d123.jpg file in the server catalog to the current directory (d: \ qint ). You can use "mget *. *" to download all files to d: \ qint.

13. delete *.*

Note: delete all files in the qint directory of the server.

14. cd ..

Note: Return to the upper-level directory, that is, the root directory. Return to the upper-level directory and use "cd...". Note that there are spaces in the middle. Use "cd \" to return the root directory \".

15. mrdir qint

Note: delete the directory qint. Delete A directory. Files And Directories cannot be deleted.

16. bye

Note: ExitFTPServer.

When uploading and downloading files, pay special attention to the current directory of the server and local computer, where the files are located. ViewFTPCurrent Directory of the serverCommandFor pwd, cd can be usedCommandLocate the server directory. LCD availableCommandLocate the directory of the local computer.

The above instances are usedFTPCommandRow-based upload/downloadCommandYou can also useCommand"?" View MoreCommand.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.