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 1PtajM-0001It-Kf for garchives@archives.gentoo.org; Sun, 27 Feb 2011 07:07:48 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 409021C061 for ; Sun, 27 Feb 2011 07:07:48 +0000 (UTC) Received: from smtpout.karoo.kcom.com (smtpout.karoo.kcom.com [212.50.160.34]) by pigeon.gentoo.org (Postfix) with ESMTP id A97DC1C008 for ; Sun, 27 Feb 2011 06:52:41 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.62,234,1297036800"; d="scan'208";a="746954734" Received: from 213-152-39-90.dsl.eclipse.net.uk (HELO compaq.stroller.uk.eu.org) ([213.152.39.90]) by smtpout.karoo.kcom.com with ESMTP; 27 Feb 2011 06:52:39 +0000 Received: from [192.168.1.104] (unknown [192.168.1.104]) by compaq.stroller.uk.eu.org (Postfix) with ESMTP id CA373A936D for ; Sun, 27 Feb 2011 06:52:36 +0000 (GMT) Content-Type: text/plain; charset=us-ascii 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 (Apple Message framework v1082) Subject: Re: [gentoo-user] Search filesystem with a wildcard From: Stroller In-Reply-To: <73cb39da-826b-4754-91f4-40e9656fe961@ZABRYSVISEXHUB2.af.didata.local> Date: Sun, 27 Feb 2011 06:52:36 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <19030C9F-4C52-44C2-9E32-F01285EBC55B@stellar.eclipse.co.uk> References: <73cb39da-826b-4754-91f4-40e9656fe961@ZABRYSVISEXHUB2.af.didata.local> To: gentoo-user@lists.gentoo.org X-Mailer: Apple Mail (2.1082) X-Archives-Salt: X-Archives-Hash: d1d9b891dc7a3d4ff3c04cba37ffcbc1 On 27/2/2011, at 6:30am, Alan McKinnon wrote: > On Sunday 27 February 2011 03:46:48 Stroller wrote: >> On 26/2/2011, at 5:33pm, Grant wrote: >>>=20 >>> find /my/folder -type f -name '*foo*.txt' >>=20 >=20 > He didn't quote the search string and neither did the grandparent. = Find will=20 > do what he's asking and it's most unlikely that's what he wants. >=20 > Grant, you have >=20 > find /my/folder -name foo*.txt >=20 > but you want >=20 > find /my/folder -name 'foo*.txt' AIUI using `find /my/folder -name foo*.txt` (i.e. unquoted) the shell = will pass the * to find if it can't expand it itself. So as long as he doesn't have a foo*.txt in his current working = directory then either command should work fine. $ ls my/folder/ foo.txt $ ls foo.txt=20 foo.txt $ rm foo.txt=20 $ find my/folder -name foo*.txt my/folder/foo.txt $ ls fo*.txt ls: cannot access fo*.txt: No such file or directory=20 $ find my/folder -name fo*.txt my/folder/foo.txt=20 $ find my/folder -name *fo*.txt my/folder/foo.txt $ find my/folder -name '*fo*.txt' my/folder/foo.txt $=20 I maintain that if OP wanted useful advice he should have demonstrated = stuff like the outputs of his find commands and of `ls foo*.txt` and `ls = /my/folder/foo*.txt`. I am getting tired of giving this advice here. Stroller.