From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PtSGL-0005CO-1y for garchives@archives.gentoo.org; Sat, 26 Feb 2011 22:05:17 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 26DF21C0C2 for ; Sat, 26 Feb 2011 22:05:16 +0000 (UTC) Received: from minas.ics.muni.cz (minas.ics.muni.cz [147.251.4.40]) by pigeon.gentoo.org (Postfix) with ESMTP id 76E9C1C004 for ; Sat, 26 Feb 2011 21:45:20 +0000 (UTC) Received: from anxur.fi.muni.cz (anxur.fi.muni.cz [147.251.48.3]) by minas.ics.muni.cz (8.13.8/8.13.8/SuSE Linux 0.8) with ESMTP id p1QLjIQO002311 for ; Sat, 26 Feb 2011 22:45:19 +0100 Received: from palantir.doma (89-24-146-54.adsl.tmcz.cz [89.24.146.54]) by anxur.fi.muni.cz (Postfix) with ESMTP id 3D8D07001F for ; Sat, 26 Feb 2011 22:45:18 +0100 (CET) Date: Sat, 26 Feb 2011 22:45:17 +0100 From: Roman Zilka To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Search filesystem with a wildcard Message-Id: <20110226224517.81a3687e.zilka@fi.muni.cz> In-Reply-To: References: <20110226031922.GA11390@Diamond.KWGR614> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.22.1; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Muni-Spam-TestIP: 147.251.48.3 X-Muni-Envelope-From: zilka@fi.muni.cz X-Muni-Virus-Test: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (minas.ics.muni.cz [147.251.4.35]); Sat, 26 Feb 2011 22:45:19 +0100 (CET) X-Archives-Salt: X-Archives-Hash: 49b14075d71e30d450f9f62619bce2f6 > >> I used to use slocate like this to search the filesystem for a file: > >> > >> foo*.txt > >> > >> but mlocate doesn't seem to accept wildcards. =A0I tried to figure out > >> how to do it with find but failed. =A0Can anyone point me in the right > >> direction? > >> > >> - Grant > > > > How about this? > > > > find -name foo*.txt ? >=20 > I can't get find to work. This works: >=20 > locate *foo*.txt >=20 > but none of these work: >=20 > find /my/folder -name foo*.txt > find /my/folder -name *foo*.txt > find /my/folder -type f -name '*foo*.txt' >=20 > What am I doing wrong? I do need the find to be recursive in that folder. Don't you have some unfortunate alias set up for 'find'? I understand you already have a working solution, but something's fishy here indeed. The third one should absolutely work. By the way, you should probably use quotes with 'locate' too. It might cause the same kind of unexpected fail in case there happens to be something which satisfies *foo*.txt in the working directory of the command. -rz