Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 May 2010 15:04:16 +0100
From:      Frank Shute <frank@shute.org.uk>
To:        Steve Bertrand <steve@ipv6canada.com>
Cc:        "questions@freebsd.org" <questions@freebsd.org>
Subject:   Re: Find a file with an unknown name
Message-ID:  <20100518140416.GA52037@orange.esperance-linux.co.uk>
In-Reply-To: <4BF1F84F.1000700@ipv6canada.com>
References:  <4BF1F84F.1000700@ipv6canada.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100518140416.GA52037>