Operating System - HP-UX
1833514 Members
3359 Online
110061 Solutions
New Discussion

How to find out files created today i.e since midnight

 
SOLVED
Go to solution
Dave Walley
Frequent Advisor

How to find out files created today i.e since midnight

Hi.

I am trying to identify files that are created today, I have used find with -mtime 0 and this identifies files created in the last 24 hours. I only want those files created since midnight.

Thanks in advance

Dave
why do i do this to myself
3 REPLIES 3
Ian Lochray
Respected Contributor
Solution

Re: How to find out files created today i.e since midnight

Dave,
you could create a file with midnight's timestamp with touch -t then do a find -newer on the file you just created.
Paul Sperry
Honored Contributor

Re: How to find out files created today i.e since midnight

Don't think you can find out creation date, just the modified date.
ls -t

-t Sort by time modified (latest first) before sorting
alphabetically.
S.K. Chan
Honored Contributor

Re: How to find out files created today i.e since midnight

You would ..
# cd /tmp
# touch 04230000 refa
# ll refa
..... 0 Apr 23 00:00 refa
Example of using the find on /var ..
# find /var -type f -newer /tmp/refa -exec ll {} \;