Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!agate!ucbvax!unisoft!greywolf From: greywolf@unisoft.UUCP (The Grey Wolf) Newsgroups: comp.unix.questions Subject: Re: how to use `find' non-recursively? Message-ID: <3334@unisoft.UUCP> Date: 31 Jan 91 19:49:53 GMT References: <1991Jan28.011044.16609@ux1.cso.uiuc.edu> Reply-To: greywolf@unisoft.UUCP (The Grey Wolf) Organization: Foo Bar and Grill Lines: 24 In article <1991Jan28.011044.16609@ux1.cso.uiuc.edu> eer36024@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@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