How to use ftp to transfer files in Linux [ftp command]

Windows

In Windows system,

  1. You can use visual ftp to transfer files,
  2. Or fill in ftp://222.200.177.152:1021/ in the folder path and enter the user name and password to connect to the FTP server (intranet).
    That is IP address + port number.

Linux

You can use the ftp command

ftp command with port

Note that there are spaces between:
for example

ftp 222.200.177.152 1021

That is, IP address port number
然后就是输入用户名和密码

use

ls

View Files.

cd

to the specified directory.

Download files using FTP

First:
before downloading a file, we first need to use lcdthe command to set the local acceptance directory location.

lcd /home/user/yourdirectoryname

If you do not specify the download directory, the file will be downloaded to the working directory when you log in to FTP.

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

get file

The file will be saved in the directory location set using the lcd command.

Wildcards and commands can be used to download multiple files mget. For example, in the following example I plan to download all files ending with .xls.

mget *.xls

Upload files using FTP

After completing the FTP connection, FTP can also upload files

Use putthe command to upload files:

put file

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

put /path/file

Likewise, multiple files can be uploaded:

mput *.xls

Close FTP connection

After completing the FTP work, the connection needs to be closed for security reasons. There are three commands to close the connection:

bye
exit
quit

If you need more help, you can use help to get more help after using the ftp command to connect to the server.

help

Guess you like

Origin blog.csdn.net/qq_45934285/article/details/131653201