Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!rpi!bu.edu!att!linac!midway!msuinfo!chroma.cps.msu.edu!raja From: raja@bombay.cps.msu.edu (Narayan S. Raja) Newsgroups: comp.unix.questions Subject: Re: how to use `find' non-recursively? Message-ID: <1991Jan28.061501.5349@msuinfo.cl.msu.edu> Date: 28 Jan 91 06:15:01 GMT References: <1991Jan28.011044.16609@ux1.cso.uiuc.edu> Sender: news@msuinfo.cl.msu.edu Reply-To: raja@cpswh.cps.msu.edu Organization: PRIP Lab, Comp. Sci. Dept., MSU Lines: 37 In article <1991Jan28.011044.16609@ux1>, (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. If you will never search for any property other than name, plain old ls -d abc* should do the job. Otherwise, the following should work, unless file abc* is itself a directory: find . ! -name "." -type d -prune -o -name abc\* -print If file abc* might possibly be a directory, find . ! -name "." ! -name abc\* -type d -prune -o -name abc\* -print will work, but find will recursively search in directories named abc*. Narayan Sriranga Raja.