Search Results

Search found 1 results on 1 pages for 'user1680819'.

Page 1/1 | 1 

  • find, excluding dir, not descending into dir, AND using maxdepth and mindepth

    - by user1680819
    This is RHEL 5.6 and GNU find 4.2.27. I am trying to exclude a directory from find, and want to make sure that directory isn't descended into. I've seen plenty of posts saying -prune will do this - and it does. I can run this command: find . -type d -name "./.snapshot*" -prune -o -print and it works. I run it through strace and verify it is NOT descending into .snapshot. I also want to find directories ONLY at a certain level. I can use mindepth and maxdepth to do this: find . -maxdepth 8 -mindepth 8 -type d and it gives me all the dirs 8 levels down, including what's in .snapshot. If I combine the prune and mindepth and maxdepth options: find . -maxdepth 8 -mindepth 8 -type d \( -path "./.snapshot/*" -prune -o -print \) the output is right - I see all the dirs 8 levels down except for what's in .snapshot, but if I run that find through strace, I see that .snapshot is still being descended into - to levels 1 through 8. I've tried a variety of different combinations, moving the precedence parens around, reording expression components - everything that yields the right output still descends into .snapshot. I see in the man page that -prune doesn't work with -depth, but doesn't say anything about mindepth and maxdepth. Can anyone offer any advice? Thanks... Bill

    Read the article

1