Linux – why is sftp rmdir not working

linuxsftpssh

I'm trying to remove a directory with lots of files and folders from my private server space. I'm logging on via SFTP fine; I can access the entire directory no problems; I can even delete individual files with rm. But this would take me forever – so I would really like to just do rmdir on the highest folder that I want to remove. But when I do this, I get

Couldn't remove directory: Failure

Any thoughts as to what I might be doing wrong?

Thanks very much,
Sam

Best Answer

In my experience, rmdir prefers to work on an empty directory. If you're trying to delete the directory foo, I would do:

$rm foo/*
$rmdir foo
Related Question