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

How to use ftp in linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

In this issue, the editor will bring you about the use of ftp 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.

Step 1: establish a FTP connection

To connect to the FTP server, type ftp in the command and then follow the FTP server's domain name 'domain.com' or IP address with a space.

For example:

Ftp domain.comftp 192.168.0.1ftp user@ftpdomain.com

Step 2: log in with a username and password

The vast majority of FTP servers are password protected, so these FTP servers ask 'username' and' password'.

If you connect to what is called an anonymous FTP server (that is, an FTP server that does not require you to have real user information is called an anonymous FTP server), try anonymous as the user name and use an empty password:

Name: anonymousPassword:

The terminal will then return the following information:

230 Login successful.Remote system type is UNIX.Using binary mode to transfer files.ftp >

Login succeeded.

Step 3: directory operation

The FTP command lists, moves, and creates folders, just as we use our computers locally. Ls can print a list of directories, cd can change directories, and mkdir can create folders.

List directories using security settings

Ftp > ls server will return: 200PORT command successful. Consider using PASV.150 Here comes the directory listing.directory list.226 Directory send OK. Print catalog

Change the directory:

To change the directory, you can enter:

Ftp > cd directory

The server will return:

250 Directory succesfully changed.

Step 4: download the file using FTP

Before downloading a file, we first need to use the lcd command to set the location of the locally accepted directory.

Lcd / home/user/yourdirectoryname

If you do not specify a download directory, the files will be downloaded to the working directory where you logged in to FTP.

Now, we can use the command get to download the file, such as:

Get file

The file is saved in the directory location set with the lcd command.

The server returns a message:

Local: file remote: file200 PORT command successful. Consider using PASV.150 Opening BINARY mode data connection for file (xxx bytes) .226 File send OK.XXX bytes received in x.xx secs (x.xxx MB/s).

Download files using FTP

You can download multiple files using wildcards and the mget command. For example, in the following example, I intend to download all files that end in .xls.

Mget * .xls

Step 5: upload files using FTP

After completing the FTP connection, FTP can also upload files

Use the put command to upload files:

Put file

When the file is no longer in the current local directory, you can use the absolute path:

Put / path/file

Similarly, you can upload multiple files:

Mput * .xls

Step 6: close the FTP connection

After completing the FTP work, you need to close the connection for security reasons. There are three commands to close the connection:

Byeexitquit

Any command can disconnect the FTP server and return:

221 Goodbye

You need more help, and you can use help to get more help after connecting to the server using the ftp command.

The above is the use of ftp in linux shared by the editor. If you happen to have similar doubts, you might as well 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.

Share To

Servers

Wechat

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

12
Report