From owner-freebsd-questions@FreeBSD.ORG Tue Mar 29 20:48:51 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13BD616A4CE for ; Tue, 29 Mar 2005 20:48:51 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id A693243D48 for ; Tue, 29 Mar 2005 20:48:50 +0000 (GMT) (envelope-from noeldude@gmail.com) Received: by wproxy.gmail.com with SMTP id 69so645110wra for ; Tue, 29 Mar 2005 12:48:50 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=gWQ3+9Mb/QstDJIGQ4lGQcMrucCS6Runw7QsQlqqV7R87hFv4qGdTkhJzhQvOeegVkACmT9S0fWdHmdmLaMYaOuFD/hw4RkzMeOpZsQ60ozizlfaWc6eBfRBMNKxWigjBQBef1ty05+YY1X2+pmshgUGMObr34l3kNJ0UbAFlaE= Received: by 10.54.98.2 with SMTP id v2mr2039536wrb; Tue, 29 Mar 2005 12:48:49 -0800 (PST) Received: by 10.54.82.4 with HTTP; Tue, 29 Mar 2005 12:48:49 -0800 (PST) Message-ID: Date: Tue, 29 Mar 2005 14:48:49 -0600 From: Noel Jones To: brianjohn@fusemail.com In-Reply-To: <4424.209.87.176.4.1112128232.fusewebmail-19592@webmail.fusemail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <4424.209.87.176.4.1112128232.fusewebmail-19592@webmail.fusemail.com> cc: freebsd-questions@freebsd.org Subject: Re: how to find files less than a day old? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Noel Jones List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2005 20:48:51 -0000 > > > FreeBSD box that I am connected to. I think it may be a Solaris 9 box. > > > Is there any way to get this to work in Solaris? > > > > > > > Maybe the solaris find command supports the -newer option. I think > > -newer is more widely supported, and likely to be available on > > Solaris. > > > > If necessary, you could then create a reference file using touch with > > the proper time stamp on it. You can do this automatically within a > > script, using the date command to figure out the current time. You > > can calculate the time one hour ago by using a command something like > > TZ={your timezone 1} date > > > > > > -- > > Noel Jones > > > Is there a way that I could do this without using find? I basically just > need a listing of files to pipe to cat. Is there any easier way to do > this? If there isn't, could you explain in more explicit email how to > this? > > /Brian > Here's some commands that should be pretty portable. touch `TZ=CST7CDT date "+%m%d%H%M"` /path/to/file find . -newer /path/to/file -type f | xargs cat > tmp.txt Adjust the value of TZ to give the proper time in your locale. I'm in Central Standard Time, which is normally expressed as CST6CDT, so I added one to get "CST7CDT". This creates a file stamped exactly one hour ago that find can use as a reference. An alternative would be to write something in perl or your programming language of choice. HTH... -- Noel Jones