lftp – advanced s/ftp/s client.

If you are dealing with ftp, ftps or sftp file transfer very likely you already have some favorite client for that purpose. I usually use FileZilla which works fantastic in graphical interface regardless it is on Linux/FreeBSD/MacOS or even Windows. For cli my first choice is lftp[1] whenever it is possible. It is maybe not easy to start with this program but it is really powerful. I highly recommend to spend a few moments to familiarize yourself with this product. It will pay off in the future, especially at the moment you will need to resume downloading 100GB file from ftps server like me recently 🙂

lftp is available under GNU license:

You can use lftp both, using interactive command or via script.

To start, assuming it is already installed just type lftp

If you are familiar with regular ftp server, you will be surprised with lots of lftp options:

With lftp command prompt you can set ftp option and then connect to the server with command connect.

If you need more detailed information, lftp can be run with option -d

Example (for ftps server):

lftp -d

The same options can be set in file ~/.lftprc.

For script processing program use option -f (lftp -f scriptfile)

The simplest scriptfile can have the following content:

open SERVER
user USERNAME PASSWORD
ls

or

open SERVER
user USERNAME PASSWORD
mirror --verbose -c --use-pget-n=3 DIRECTORYTODOWNLOAD .;

Of course, lftp provide much more functionality, including file download resume (-c).

Documentation:

[1] https://lftp.yar.ru/lftp-man.pdf
[2] https://unix.stackexchange.com/questions/592624/how-to-connect-to-server-with-tls-using-lftp
[3] https://www.librebyte.net/en/ftp-en/lftp-fatal-error-certificate-verification-not-trusted/
[4] https://superuser.com/questions/623236/simple-command-to-connect-to-ftps-server-on-linux-command-line
[5] https://danielhoherd.com/tech-notes/jdupes/
[6] https://serverok.in/download-all-files-from-ftp-server-using-lftp
[7] https://x8t4.com/12-lftp-commands-for-managing-files-with-examples/
[8] https://lftp.yar.ru/lftp-man.pdf
[9] https://www.reddit.com/r/linux/comments/4anfej/lftp_segmented_downloads_made_simple/
[10] https://ourcodeworld.com/articles/read/788/how-to-download-a-remote-directory-with-lftp-sftp-using-a-lftp-script

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Free(BSD)
Search for duplicated files

This will be short (but hopefully I will find more time to show entire process to search duplicated files together with some examples). In case you are searching for duplicated files I can recommend two software which actually rocks in openSource world

Linux
2
“Gaming laptop”, steam link and rustdesk.

Not really related to this article, but just wanted to describe the situation.  Most of the time I am working on Linux or Mac. Not a big deal, but last year we bought my daughter a kind of gaming laptop. I am saying kind of, because IMHO there is no …

Azure
NFS issue, cannot be mounted or is not visible

The same kind of issue I have encountered numerous times while working across different environments and with various customers. The problem with NFS mounts connected from remote locations is so common. This issue extends beyond communication solely over WAN and also include connections between datacenters (DC) where we lack control …