[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

find traverses through directory while it's excluded

From: PenguinWhispererThe .
Subject: find traverses through directory while it's excluded
Date: Fri, 12 Feb 2016 13:46:07 +0100

Good day to you all,

A user experienced something in find that makes me wonder why find is
behaving like this(maybe it's actually a "feature", something that in
corner-cases is useful).

It happens when excluding a directory with the ! parameter (-not).
So find -L /src/tree/ -not -iwholename *excludedir* ...
The directory is rather big and at some point you have a loop due to
symbolic links (this is not something we can easily change). The symlinks
should be followed. Find detects a loop and skips that directory. That in
itself is fine however it's not optimal as it will take plenty more time
for the full execution of the command.

So while someone might think -not -iwholename excludes that directory that
is looping it will still traverse it.
Why is find still traversing if a directory is excluded?
Is this for corner-cases? Can someone give an example of those?

I understand there is the -prune option for this. I'm just trying to
understand why(and there might be a very good reason) :)

Thanks in advance!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]