In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about how to use the ftp command in Linux. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
The general format of the Linux ftp command is as follows:
$ftp hostname / IP
Where "hostname / IP" is the host name or IP address of the remote machine to which you want to connect. On the command line, the hostname is an option, and if you specify a hostname, ftp will attempt to connect to the remote machine's ftp service program; if you do not specify a hostname, ftp will give you a prompt and wait for the user to enter a command:
$ftp
Ftp >
At this point, enter the open command plus the hostname or IP address at the ftp > prompt, and you will attempt to connect to the specified host.
No matter which method is used, if the connection is successful, you need to log in on the remote machine. If the user has an account on the remote computer, he can use the account through ftp and need to provide a password. The read and write permissions of the user account on the remote machine determine what files the user can download and in which directory the uploaded files can be placed on the remote machine.
If you don't have a dedicated login account for a remote machine, many ftp sites have special accounts that you can use. The login name of this account is anonymous (also known as anonymous ftp), and when using this account, you are required to enter an email address as your password.
If the remote system provides an anonymous ftp service, users can use this service to log in to a special directory for public use. Generally speaking, two directories are specially provided: the pub directory and the incoming directory. The pub directory contains all the files that are available to the public at the site, and the incoming directory holds the files uploaded to the site.
Once the user has successfully logged in at the remote site using ftp, they will get the prompt "ftp >". You are now free to use the commands provided by ftp, you can use the help command to get a list of available commands, or you can specify a specific command name after the help command to get a description of the command.
The most commonly used commands are:
Ls lists the current directory of remote machines
Cd changes the working directory on the remote computer
Lcd changes the working directory on the local machine
Ascii sets the file transfer mode to ASCII mode
Binary sets the file transfer mode to binary mode
Close terminates the current ftp session
Hash displays a # sign every time it transmits data in the data buffer.
Get (mget) transfers the specified file from the remote machine to the local machine
Put (mput) transfers the specified file from the local machine to the remote machine
Open connects to a remote ftp site
Disconnect from the remote computer and exit ftp
? Show local help information
! Go to Shell
The following is a brief introduction to the common ftp commands.
◆ starts a ftp session
The open command is used to open a session with a remote host. The general format of the command is:
◆ open hostname / IP
If you want to connect to more than one site during a ftp session, you usually only use the ftp command with no parameters. If you only want to connect to one computer during the session, specify the remote hostname or IP address on the command line as an argument to the ftp command.
◆ terminates a ftp session
The close, disconnect, and bye commands are used to terminate a session with a remote machine. The close and disronnect commands close the connection to the remote machine, but leave the user in the ftp program on the local computer. Both the and bye commands close the user's connection to the remote machine, and then exit the ftp program on the user's computer.
◆ changes the directory
The "cd [directory]" command is used to change the directory on the remote machine during a ftp session, and the lcd command changes the local directory so that the user can specify where to find or place local files.
◆ remote directory list
The ls command lists the contents of the remote directory, just like using the ls command in an interactive shell. The general format of the ls command is:
Ls [directory] [local file]
If you specify a directory as an argument, ls lists the contents of that directory. If you give the name of a local file, the directory list is placed in the file you specified on the local machine.
◆ gets files from a remote system
The get and mget commands are used to get files from a remote machine. The general format of the get command is:
Get file name
You can also give the local file name, which is the file name when the file to be obtained was created on your local machine. If you do not give a local file name, use the original name of the remote file.
The mget command gets more than one remote file at a time. The general format of the mget command is:
List of mget file names
Use a space-delimited or wildcard list of file names to specify the files to get, and for each of these files, the user is asked to confirm whether or not to transfer.
◆ sends files to the remote system
The put and mput commands are used to send files to the remote machine. The general format of the Put command is:
Put file name
The mput command sends more than one local file at a time. The general format of the mput command is:
List of mput file names
Use a space-delimited or wildcard list of file names to specify the file to send. The user is asked to confirm whether to send each of these files.
◆ changes the file transfer mode
By default, ftp transfers files in ASCII mode, and users can specify other modes as well. The function of the ascii and brinary commands is to set the mode of transmission. Transferring files in ASCII mode is very good for plain text, but to avoid damage to binary files, users can transfer files in binary mode.
◆ checks the transmission status
When transferring large files, you may find it useful to have ftp provide feedback about the transfer. The hash command causes ftp to print a # character on the screen each time it has transferred data from the data buffer. This command can be used both when sending and receiving files.
Local commands in ◆ ftp
When you use ftp, the character "!" Used to send a command to the command shell on the local machine. This is useful if the user is in a ftp session and needs shell to do something. For example, the user wants to set up a directory to save the received files. If you type! mkdir new_dir, Linux creates a directory called new_dir in the user's current local directory.
This is how the ftp command in Linux shared by Xiaobian is used. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.