In this answer, what is the use of -! in find?Consider the following code:find . -type l -! -exec test -e {} \; -printThis alternative seems to do the same exact thing:find . -type l ! -exec test -e {} \; -printIt appears the -! works like !, meaning negation of the following expression. Which makes sense. But why not just ! then? I can't seem to find any documentation on such syntax.
What purpose does the minus (-) in `find -! -exec` serve?
find
Accepting -! in addition to the standard ! (and likewise for other punctuation operators: (, ), and the GNU-specific ,) is a quirk of the command line parser of GNU find. The code just happens to be slightly easier to write if it doesn't reject -! and the like as ill-formed. Since -! would otherwise be an error, there's no harm in accepting it. The POSIX standard doesn't say anything about what -! means: as far as the standard is concerned, it's an implementation-defined predicate, which implementations are free to use to  mean whatever they want.Here's an overview of how the code in GNU find works:The parser code contains a list of operators. Operators are stored without their leading -, to make the code slightly smaller and faster.The command line parser calls looks_like_expression to determine whether an argument looks like a predicate. Predicates begin with -, except for the single-punctuation-character operators.Once the predicate has been determined, find_parser ignored the leading - if there is one. This is the point where the distinction between ! and -! is lost.looks_like_expression or find_parser could reject - followed by a punctuation character. But either way it would require additional code for no real benefit.