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)
yt-dlp – download your data from youtube

Hi, this short article only to mention that there is a wonderful application that exists for a years for the purpose to download YOUR or maybe some other movies from youtube. I don’t want to go in to legal aspect too much, what can be downloaded from youtube, what not …

Linux
Migrate WordPress site to another hosting service.

IntroductionThis article details the migration of WordPress site (exactly this site you are now on) from one service provider to Amazon Lightsail. There might be various reason to do that (mine is outlined below) but in general I hope to share the message that especially with WordPress, migration can be …

Free(BSD)
Convert pdf file to jpeg – with imagemagic

Short article just to write down not-so frequently (for me) task: remove /opt/homebrew/bin from that command where using on other system than macOs Options: cheers