18,777
社区成员
发帖
与我相关
我的任务
分享
-ok command ;
Like -exec but ask the user first. If the user agrees, run the command. Otherwise
just return false. If the command is run, its standard input is redirected from
/dev/null.
The response to the prompt is matched against a pair of regular expressions to
determine if it is an affirmative or negative response. This regular expression is
obtained from the system if the `POSIXLY_CORRECT' environment variable is set, or
otherwise from find's message translations. If the system has no suitable defini‐
tion, find's own definition will be used. In either case, the interpretation of
the regular expression itself will be affected by the environment variables
'LC_CTYPE' (character classes) and 'LC_COLLATE' (character ranges and equivalence
classes).
从man给出的信息来看,最明显的区别就是-ok是交互式的,在执行后面的命令之前,需要用户确认;-exec不需要确认直接执行。