Link to home
Start Free TrialLog in
Avatar of houde
houde

asked on

Avoiding 'Find' to search in subdirectories

I want to perform a search using the 'find' command but I don't want it to search into the subdirectories as it's defaulted to.  I'm under IRIX 6.4
Avatar of ozo
ozo
Flag of United States of America image

-prune
Avatar of houde
houde

ASKER

That's what I tried!
If I include it before -name, nothing returned.
If I include it after -name "pattern", I get the same result as without -prune
To find a find in the current directory, but not recurse into
subdirectories:

find . -name 'pattern' -maxdepth 1

Avatar of houde

ASKER

maxdepth is not an option of the find command under IRIX 6.4
find . -print \! -name '.' -prune
ASKER CERTIFIED SOLUTION
Avatar of Taliesin
Taliesin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial