From owner-freebsd-questions@FreeBSD.ORG Tue Mar 29 20:30:33 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 33FF616A4CE for ; Tue, 29 Mar 2005 20:30:32 +0000 (GMT) Received: from fuse1.fusemail.net (smtp.fusemail.net [69.31.1.141]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B54343D5A for ; Tue, 29 Mar 2005 20:30:32 +0000 (GMT) (envelope-from brianjohn@fusemail.com) Received: from fusemail.com by fuse1.fusemail.net with asmtp (FuseMail extSMTP) id 1DGNM1-0006Qg-5U; Tue, 29 Mar 2005 14:30:25 -0600 Received: from 209.87.176.4 (FuseMail web AccountID 19592) by webmail.fusemail.com with HTTP; Tue, 29 Mar 2005 14:30:32 -0600 (CST) Message-ID: <4424.209.87.176.4.1112128232.fusewebmail-19592@webmail.fusemail.com> Date: Tue, 29 Mar 2005 14:30:32 -0600 (CST) From: "Brian John" To: "Noel Jones" , freebsd-questions@freebsd.org User-Agent: FuseMail W MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 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: brianjohn@fusemail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2005 20:30:33 -0000 > On Tue, 29 Mar 2005 14:11:45 -0600 (CST), Brian John > wrote: > > > On Tue, 29 Mar 2005 13:02:37 -0600 (CST), Brian John > > > wrote: > > > > Hello, > > > > I'm trying to write a script to concatenate a bunch of files. > > Basically I > > > > want to grab a bunch of files out of a directory that are less than an > > > > hour or so old and put them in one file. > > > > > > > > This is what I am using so far: > > > > > > > > find . -mtime -1 -type f | xargs cat > temp.txt > > > > > > > > However, this only grabs files that are less than a day old, so I get > > some > > > > files returned that I don't want. I tried using -0.5 instead of -1 > > and it > > > > didn't work. How can I accomplish this? > > > > > > > > > > > > > find . -mtime -1h -type f .... > > > > > > man find > > > > > > > > > -- > > > Noel Jones > > > _______________________________________________ > > > freebsd-questions@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > > To unsubscribe, send any mail to > > "freebsd-questions-unsubscribe@freebsd.org" > > > > > > > > I read the man page and didn't see that. It doesn't appear to work on the > > box that I am ssh-ing to. Sorry, I should have mentioned that it is not a > > 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