
현재 특정 디렉토리를 내림차순으로 피하는 find 명령이 있습니다.
find . \! \( -name ".hg" -prune \) \! \( -name "localhost" -prune \) \! \( -name "logs" -prune \) -type f
명령은 내가 원하는 대로 작동하지만 좀 더 간결한 솔루션을 찾고 있습니다. 내 자신을 많이 반복하고 있는 것 같은 느낌이 들며, 동일한 작업을 수행하려면 더 우아하고 더 짧은 방법이 있어야 합니다.
답변1
find . \( \( -name .hg -o -name localhost -o -name logs \) -prune \) -o -type f
답변2
find . -not \( -regex ".*/(.hg|localhost|logs)" -prune \) -type f