lftp: recursively delete a non-empty directory

The base lftp command for this is:

lftp -r dirname

But if the directory contains hidden files it will fail stating:

rm: Access failed: 550 dirname: Directory not empty

The solution is to set the following after logging in:

set ftp:list-options -a
[/code]

Now recursive delete will work.


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.