Use lftp in linux

Source: Internet
Author: User
Tags openssl library
In linux, use lftp-Linux Enterprise Application-Linux server application information. For more information, see. I always wanted to find an ftp client that can match FlashFXP in linux. I tried several ftp clients in GUI, including free and non-free, however, the comrades who have actually used it should be clear that they are lj, and I am afraid they have hurt the author's mind, but I can't find any other descriptions. After turning around and returning to lftp, there is no GUI. For Beginners, although there is a little pain, as long as you think about it, lftp can stand in many clients for so many years, it is still the most popular tool in linux, which is enough to show that its functions and ease of use are both good. In my experience, it is worthwhile to spend some time learning lftp. Don't try to find the gui ftp Client in vain. In the unix world, there is no FlashFXP!

The lftp logon operations are simple in several ways.

1. In one breath
$ Lftp (ftp: //) user: password @ site: port
It is usually used for the off-the-shelf links provided on web pages or bbs. The disadvantage is that the password is displayed as a plain text. We recommend that you input it in a dark environment without any one.
$ Lftp (ftp: //) user @ site: port
Then the system will prompt you to enter the password, which is ***

2. Regular Expression

$ Lftp site-p port-u user, password
This is the standard method provided in the lftp instruction document. This method is labor-intensive. Please do your best according to your health condition. If the physical fitness is normal, you can
$ Lftp site: port-u user, password
It seems a little easier. I usually use this method.

3. Hide a length in the five short periods

This is a method for Recursive nesting #@! × &
$ Lftp
Lftp: ~> Lftp user: password @ site: port
That is to say, the operations on the lftp console are exactly the same as those on the system terminal. You can still use the first two tricks with no scruples, or use o or open instead of lftp, you can also enter the format of the user name and password of the Website Based on your preference.

4. Ultimate Success

Every time I log on, I have been hitting a user: password @ site: port for a long time. Even if Li tie is here, I cannot help myself. Therefore, we still need to let lftp write down frequently-used sites, just like the platform manager in FlashFXP, which is called bookmark in lftp. Let's talk about it later.

The first thing to do after logging on is to see what is good on this server.
The operation is the same as in the terminal. ls is used to list the server directories. One thing to note is that after the first ls operation, the directory table is saved to the local cache, so that the latest list under this directory cannot be obtained after the ls operation. In this case, you can use rels to download the directory table again. Here, the cache is the default setting of lftp. The purpose is to get a list faster, but sometimes it does not match your usage habits. You can use cache on and cache off to switch the cache, or use cache flush to clear the cache.
There is nothing to say about changing the directory. lftp also supports the tab matching function, greatly reducing the labor intensity.

Lftp supports six modes: ftp, ftps, http, https, hftp, fish and file (of course, https and ftps support must be compiled together with openssl library ).

Lftp has built-in shell-like command format, allowing multiple commands (&) to be executed at the same time in the background (&). All background tasks are executed in the same program (process). commands that can be run in the foreground can be executed in the background (Ctrl-z ), or get back the foreground execution (wait or fg) from the background, or even determine whether to execute the current command (& |) through the return value of the previous command ).

When lftp is finished, if there is still a program running, Will lftp switch itself to the no hup mode? K is placed in the background for execution. Therefore, you do not have to worry about the failure to log out during lftp execution.

!
Execute commands in the local shell, such! Ls/usr/local/bin/
Caused by lftp? K does not have lls (commands for displaying the local file list), so it is available! Ls.

Alias []
Define aliases
Alias less more
Alias reconnect "close; cd ."
Enter alias directly to see the aliases currently defined. If you only enter alias name, the alias name is canceled.

Bookmark SUBCMD
Set books ?, Can I set the current platform and directory to a book ?, You can come in directly next time without cd.

Bookmark add name is used to add a book named name?
Bookmark del name: delete a book named name?
What books are currently set in the bookmark list? (In addition, the result of directly typing bookmark and bookmark list is the same)
Bookmark edit call editor modify book? (~ /. Lftp/bookmarks)

Cd switch remote directory

Cache SUBCMD
Manage lftp cache

Rels []
Display the remote file list from the cache
Rels will not read from the cache

Recls opts [path/] pattern
Display the remote file list from the cache. It should be an enhanced version of ls. There are many parameters available, which should be used to generate various> file lists for use by other programs.
Recls will not read from the cache

Du options
Calculate the entire remote directory? Zimeng nān? Br/>
Get OPTS-o
Capture remote files

Get rfile-o lfile
Capture rfile and rename it lfile
-C: Resume
-E. After the file is captured, the remote file is cut down.
-A is an ascii mode and the default value is binary mode.
-O sets the base directory as the directory for storing files on the local end.

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.