Date: Wed, 30 Mar 2005 09:19:34 -0600 (CST) From: "Brian John" <brianjohn@fusemail.com> To: "Noel Jones" <noeldude@gmail.com>, freebsd-questions@freebsd.org Subject: Re: how to find files less than a day old? Message-ID: <4656.209.87.176.4.1112195974.fusewebmail-19592@webmail.fusemail.com>
next in thread | raw e-mail | index | archive | help
> > > > 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
>
Thanks! That worked.
/Brian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4656.209.87.176.4.1112195974.fusewebmail-19592>
