find: missing argument to `-exec'


今天使用find命令查找删除文件时,遇到下面错误,这个是因为在{}和\之间必须要有空格,否则会报上面的错。 以前都没有注意到这个细节,特此记录一下。

 

[root@DB-Server full]#  find  . -maxdepth 1 -type d  -mtime +3 -exec rm -rf {}\;
find: missing argument to `-exec'
[root@DB-Server full]#  find  . -maxdepth 1 -type d  -mtime +3 -exec rm -rf {} \;
[root@DB-Server full]#

 

image

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM