FTP Delete non empty directory FTP Delete non empty directory unix unix

FTP Delete non empty directory


I got it to work in two steps, on a server with restricted access, no SFTP, only FTP through commandline.

Like this :

mdelete folder_name/*rmdir folder_name


If you've hidden files or folders on your server (for example .folder), you have to set the lftp list-options to "-a".

So this worked for me:

$ lftp -u user,pass server> set ftp:list-options -a> cd /folder/to/be/empty//folder/to/be/empty/> glob -a rm -r *


Use lftp to log into your server, this supports the rm -r command.

lftp user, password server

then:

rm -r directory

the -r stands for "recursive".

info: