how to use `find' non-recursively?

The Grey Wolf greywolf at unisoft.UUCP
Fri Feb 1 06:49:53 AEST 1991


In article <1991Jan28.011044.16609 at ux1.cso.uiuc.edu> eer36024 at uxa.cso.uiuc.edu (Erik Reuter) writes:
>What I want to do is to search the current directory for all files matching
>a certain name, say -name abc\* , but I *do not* want find to descend into
>any subdirectories.
> 
>find . -type d -prune -o -name abc\* -print
> 
>does not seem to work, since it prunes *everything*, including the . directory.
> 
>Any suggestions?

find . -type d ! -name . -prune -o -name abc\* -print

(excludes "." from the "-prune" restriction)

>
>--
>Erik Reuter, Internet: e-reuter at uiuc.edu  UUCP: uunet!uiucuxc!uiuc.edu!e-reuter


-- 
thought:  I ain't so damb dumn!
war: Invalid argument
...!{ucbvax,acad,uunet,amdahl,pyramid}!unisoft!greywolf



More information about the Comp.unix.questions mailing list