설명 find
의
다양한 구현은 man
페이지에 operands
다른 이름을 호출하는 경향이있다. 그러나 posix
표준을 따르는 모든 find
구현의 일반적인 실행은 동일합니다.
find [-H | -L] path ... [operand_expression ...]
매뉴얼 페이지 따옴표 posix find man page
에서 가져온 경우 각각의 설정이 감동 expressions
, 즉 명시 적 연산자 expressions
분리가없는 (-operand (Argument)
을 의미), 분리 암시 -a
(AND) 연산자를 가지고 그들.
expression [-a] expression
Conjunction of primaries; the AND operator is implied by the juxtaposition of
two primaries or made explicit by the optional -a operator.
The second expression shall not be evaluated if the first expression is false.
결론
그래서 expressions
왼쪽에서 오른쪽으로 실행해야합니다 posix
표준을 따르는 모든 구현; 및
find . -type d -mount -ctime +5 -prune -exec 'rm {}' \;
모든 이전 operands
에 해당하는 경우 -exec
만 실행된다는 것을 의미
find . -type d -a -mount -a -ctime +5 -a -prune -a -exec 'rm {}' \;
에 해당합니다.
다른 또한 -exec
이 발견 구현에 의해 명시 적으로 action
를 호출 할 수 없습니다 수 있지만, 그것은 여전히 (즉 -print
조치를 교체)
If no expression is present, -print shall be used as the expression.
Otherwise, if the given expression does not contain any of the primaries -exec,
-ok, or -print, the given expression shall be effectively replaced by:
(given_expression) -print
유사한 방식으로 치료를받을 것을 주목할 필요가
편집
기술적으로 사실이없는 모든 IMPL 진술은 posix 불만이어야합니다. 대답에 관련없는 solaris find man page
expression [-a] expression
Concatenation of primaries (the and operation is implied by the juxtaposition of two primaries).
에서 거의 동일 견적을 He're,하지만 난'RM은 {}'인용해야한다고 생각하지 않습니다. 쉘이 어떤 식 으로든 먼저 해석 할 경우'{}'를 인용 할 수 있고, 대부분의 쉘에서 인용 부호를 사용하지 않을 수도 있습니다. – BroSlow