Unix command

neilm

Golden Member
Aug 25, 2002
1,108
0
0
Hi,

I'm looking a command to get files of a certain date. I was going to use ls -l | grep "Feb 23", but that wouldn't work when files are exactly a year old (Feb 23 2006) - it would still pick them up.

Does anyone have a good alternative?
 

neilm

Golden Member
Aug 25, 2002
1,108
0
0
Originally posted by: n0cmonkey
The find command should work.

How? Can you give me an example because I doubt -mtime or -ctime will work since they find files on age, not a certain date i.e. using find . -ctime +24 will give me files today plus files yesterday (if you understand what I'm saying).
 

neilm

Golden Member
Aug 25, 2002
1,108
0
0
Originally posted by: n0cmonkey
Solaris: Don't use the +.
+n more than n
n exactly n
-n less than n

EDIT: I don't have AIX. :(

I suppose I can still try the find, go in tomorrow and check if the +/- ranges are allowed... can't see why not. Thanks. If there is a more elegant approach, someone can always chime in :)
 

neilm

Golden Member
Aug 25, 2002
1,108
0
0
No, doesn't work for the reason that when you do mtime, it will find results from that point entering the command, to the same 24hrs ago, or whatever the argument is. It will not give me a "all day" results, i.e. yesterday, the find mtime will give me bits inbetween.
 

neilm

Golden Member
Aug 25, 2002
1,108
0
0
But find only spits out the filename, not including the date. I have found a solution so it is okay, thanks anyway.