简体   繁体   English

solaris sftp:删除远程文件夹

[英]solaris sftp: remove remote folder

Does anybody know how to remove remote directory via sftp? 有人知道如何通过sftp删除远程目录吗? sftp doesn't support "rm -r" only "rm", so the only way I see is to save remote folder tree in a file with "rm" prefix and then execute sftp -b file And as sftp doesn't support "ls -lR" either I have to use "ls -l" in the loop to create such a file. sftp不支持“rm -r”仅“rm”,所以我看到的唯一方法是将远程文件夹树保存在带有“rm”前缀的文件中,然后执行sftp -b file并且因为sftp不支持“ ls -lR“要么我必须在循环中使用”ls -l“来创建这样的文件。

Is there an easier way? 有更容易的方法吗? Thanks in advance. 提前致谢。

http://linux.about.com/od/commands/l/blcmdl1_sftp.htm shows that you can use rmdir http://linux.about.com/od/commands/l/blcmdl1_sftp.htm显示可以使用rmdir

see the answer at https://superuser.com/questions/595401/why-is-sftp-rmdir-not-working 请参阅https://superuser.com/questions/595401/why-is-sftp-rmdir-not-working的答案

direct quote from Chris : 克里斯直接引用:

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

del -s是否会做您想做的事情?

rm -r seems to work fine for recursively removing a remote directory with files in it. rm -r似乎可以正常工作,以递归方式删除包含文件的远程目录。

$ sftp --version
sftp: SSH Tectia Client 6.0.2 on sparc-sun-solaris2.8
Build: 84
Product: SSH Tectia Client
License type: commercial
SFT API: 2.0.3 (build 6.0.2.84)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM