今天使用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]#