Recursive delete with sftp

recursivesftp

I have a host that I can only access with sftp, scp, and rsync– no ssh. I have a large tree of directories that I want to delete, but my sftp client apparently does not support recursive rms or rmdirs. In the help screen, it shows I can do recursive puts, but that doesn't help me.

How can I delete my files?

Best Answer

You can use the lftp client to do this. The the -r option to lftp rm recursively deletes directories and files.

$ lftp -u <user>,<pass> <server> 
lftp> rm -r <directory>

References

Related Question