Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File 是否由用户查找文件和文件夹,然后通过一个ssh命令将其删除?_File_Ssh_Directory - Fatal编程技术网

File 是否由用户查找文件和文件夹,然后通过一个ssh命令将其删除?

File 是否由用户查找文件和文件夹,然后通过一个ssh命令将其删除?,file,ssh,directory,File,Ssh,Directory,尝试使用: find /home/ -user student -exec rm -fr {} 或 但是出现了错误消息:find:缺少'-exec'的参数欢迎使用stackoverflow 最简单的方法(甚至在[find(1)][1]的手册页中提到)是: 适合您的情况: find /home/ -user student -print | xargs /bin/rm -rf 但当然,如何完成这项任务有几个变体。您可以使用-exec从不同的示例开始: find . -type f -exe

尝试使用:

find /home/ -user student -exec rm -fr {} 


但是出现了错误消息:
find:缺少'-exec'的参数

欢迎使用stackoverflow

最简单的方法(甚至在
[find(1)][1]
的手册页中提到)是:

适合您的情况:

find /home/ -user student -print | xargs /bin/rm -rf

但当然,如何完成这项任务有几个变体。您可以使用
-exec
从不同的示例开始:

find . -type f -exec file '{}' \;
适合您的用例:

find /home/ -group student -exec rm -rf '{}' \;
find . -type f -exec file '{}' \;
find /home/ -group student -exec rm -rf '{}' \;