If you’re trying to figure out how to recursively download a directory with lftp, the wonderful command-line FTP and SFTP client, this is what you want:
mirror <directory>
… and that’s that. Hopefully this will be more helpful to someone than the current Google documentation results.
Update: Thanks to molok in the comments, here’s how you upload recursively:
mirror -R <directory>






7 Comments
I love lftp. It’s great.
I use mget all the time, and mirror is really useful as you suggest.
As a related tip: Did you know you can use lftp on http as well? It understands directory indexing (such as Apache’s) and presents it in the simple lftp interface we all know and love.
lftp: the zsh of ftp clients. Fucken’ A man.
@Andre Pang: Crazy zsh mans!
and ‘mirror -R’ to upload a directory… awesome.
At least in Debian you need to use lftp -e mirror http://ftp.example.com for mirroring remote site.
@Domas: Thanks, I’ve updated the post so it doesn’t suggest direct shell use.
its annoying that you cant do a glob on a directory like:
> mirror Foobar.*