FTP upload and download using lftp command in Linux system

Source: Internet
Author: User
Tags ftp login

More commands and software are appropriate for FTP operations. Linux under the common operation commands are FTP, LFTP and SFTP, graphical interface is very easy to use FileZilla. However, in the server command interface, I still feel that lftp is more convenient to use, the function is more powerful than FTP. Lftp's interface is much like the Linux shell, with command completion, history, allowing multiple background task execution, bookmarks, queues, mirroring, breakpoint continuation, and multiple process downloads.

Log on to the FTP command

Code:

LFTP Username: password @ftp address: Transfer port (default 21)

Usage

(1) Lftp username:password@127.0.0.1:21 carriage return
(2) Lftp username@127.0.0.1 return # #默认21端口 Enter the password after entering
(3) Lftp 127.0.0.1 Enter # #回车后 Login Login
(4) Lftp carriage return--> open 127.0.0.1--> Login Login

The following is a brief introduction to LFTP's simple use and common commands.

1, Login

Lftp Ftp://user:password@site:port
Lftp User:password@site:port
Lftp site-p port-u User,password
Lftp Site:port-u User,password

You can use the above commands to achieve FTP login, if you do not enter a password, you will be prompted to enter.

20160315215154328

2, PWD and lpwd

Like the bash shell, the PWD command displays the current working directory on the server side; Lpwd is used to display the current working directory on the local machine.

3, LS and! Ls

The LS command lists the contents of the server-side directory;!ls is used to list the contents of the directory on the local machine.

4, CD and LCD

After entering the FPT site, the CD command is used to switch paths on the server side, and the LCD is used to switch paths on the local machine.

5, download

A, get and mget

Used to download data from FTP. Get is used to download a file, mget is used to download multiple files. The usage and parameters are as follows:

Get [E] [-A] [-c] [-O-base] rfile [-o lfile] ...
Mget [-c] [-d] [-a] [E] [-O base] Files
-C
Support Breakpoint Continuation.
-E
Delete server-side data after successful download
-A
Download using ASCII mode, default to binary mode download
-D
Create and download a folder with a consistent file name and save the file in a folder
-O string
Specify the path that the download file is stored in
-O string
Save data to this file by downloading data from the GET command
Lftp

B, Pget

Used to download data from FTP. This command allows you to download data using multiple connections, increasing the download speed, but increasing the load on both the server side and the network. The usage and parameters are:

Pget [OPTS] rfile [-O lfile]
-C
Continuous transmission of the branch
-N int
Set maximum number of connections

6, Upload

A, put, mput

Used to upload data to the server side. Put is used to upload a file, mput is used to upload multiple files. The usage and parameters are:

Put [-e] [-A] [-c] [-O-base] lfile [-O rfile]
Mput [-c] [-d] [-a] [E] [-O base] Files
parameter is consistent with the Get/mget parameter.


7, lftp Chinese garbled problem

For beginners like me, after login to see the Chinese garbled (because the general Local is Utf-8 code), how half, with the set command to solve
Set Ftp:charset GBK (or gb2312 or utf-8) # #设置ftp端的编码格式
Set File:charset utf-8 (.....) IBID.) # #设置本地编码格式

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.