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
-prune
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
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
subdirectories:
find . -name 'pattern' -maxdepth 1
ASKER
maxdepth is not an option of the find command under IRIX 6.4
find . -print \! -name '.' -prune
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.