From owner-freebsd-questions@FreeBSD.ORG Tue May 18 15:00:12 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99894106566B for ; Tue, 18 May 2010 15:00:12 +0000 (UTC) (envelope-from frank@esperance-linux.co.uk) Received: from asmtp3.iomartmail.com (asmtp3.iomartmail.com [62.128.193.159]) by mx1.freebsd.org (Postfix) with ESMTP id E75B78FC0C for ; Tue, 18 May 2010 15:00:11 +0000 (UTC) Received: from asmtp3.iomartmail.com (localhost.localdomain [127.0.0.1]) by asmtp3.iomartmail.com (8.13.8/8.13.8) with ESMTP id o4IE4ITJ021470; Tue, 18 May 2010 15:04:18 +0100 Received: from orange.esperance-linux.co.uk (77-44-105-82.xdsl.murphx.net [77.44.105.82]) (authenticated bits=0) by asmtp3.iomartmail.com (8.13.8/8.13.8) with ESMTP id o4IE4Hl5021457; Tue, 18 May 2010 15:04:17 +0100 Received: by orange.esperance-linux.co.uk (Postfix, from userid 1001) id 9418D33C1F; Tue, 18 May 2010 15:04:16 +0100 (BST) Date: Tue, 18 May 2010 15:04:16 +0100 From: Frank Shute To: Steve Bertrand Message-ID: <20100518140416.GA52037@orange.esperance-linux.co.uk> References: <4BF1F84F.1000700@ipv6canada.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BF1F84F.1000700@ipv6canada.com> User-Agent: Mutt/1.4.2.3i X-Face: *}~{PHnDTzvXPe'wl_-f%!@+r5; VLhb':*DsX%wEOPg\fDrXWQJf|2\,92"DdS%63t*BHDyQ|OWo@Gfjcd72eaN!4%NE{0]p)ihQ1MyFNtWL X-Operating-System: FreeBSD 8.0-STABLE amd64 X-Organisation: 'shute.org.uk' Cc: "questions@freebsd.org" Subject: Re: Find a file with an unknown name X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Frank Shute List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2010 15:00:12 -0000 On Mon, May 17, 2010 at 10:15:43PM -0400, Steve Bertrand wrote: > > I want to find a file that was recently created. > > The content within the file is known, so I can grep for that. The > directory structure that contains the file is also known. The filename > is not known. > > What command string do I use to search a directory structure for a file, > when my search pattern only matches content and not filename? > > Steve To find files that I've recently created, I use the -Btime flag of find. E.g: find . -type f -Btime 1 find files created in the last 24 hours. Regards, -- Frank Contact info: http://www.shute.org.uk/misc/contact.html