"find" command to find file on specific date?

"find" command to find file on specific date?

Post by Pisut Tranchindavong - SCCS - 37371 » Wed, 03 Apr 1996 04:00:00



Hi,
   Does anyone please tell me that the find command can be used to find file on specific date?
For instance: find . -date 960331 -print

Regard,
Pisut T.

 
 
 

"find" command to find file on specific date?

Post by Rich K » Wed, 03 Apr 1996 04:00:00




Quote:>Hi,
>   Does anyone please tell me that the find command can be used to find file on specific date?
>For instance: find . -date 960331 -print

>Regard,
>Pisut T.

   man find

   richk

 
 
 

"find" command to find file on specific date?

Post by Bill Marc » Wed, 03 Apr 1996 04:00:00




Quote:>Hi,
>   Does anyone please tell me that the find command can be used to find

file on specific date?
Quote:>For instance: find . -date 960331 -print

man find
With most versions of find, you have to calculate how many days ago that
date was, and use
find . -mtime 2 -print
(960331=2 days ago).

--

From the future home of the 270 Foot Jesus

 
 
 

"find" command to find file on specific date?

Post by David and Rachel Weintra » Mon, 08 Apr 1996 05:00:00




Quote:> Hi,
>    Does anyone please tell me that the find command can be used to find

file on specific date?

Quote:> For instance: find . -date 960331 -print

I cheat and simply create a file:

touch 960331 /tmp/foo       #Assumes midnight of March 31st.

find . -newer /tmp/foo -print

This will get me files NEWER than that date. To find files modified
exactly on that date takes two files:

touch 960401 /tmp/foo
touch 960331 /tmp/bar

find . \( ! -newer /tmp/foo \) -newer /tmp/bar -print

You'll have to try that last one to see if it works. I am unable to test
it right now. The idea is to find files that are NOT newer than Midnight
April 1st (that is Mar 31th and older) and all files that are also newer
than midnight, Mar 30th. This SHOULD mean only those files actually dated
March 31st.

Another possibility is to use -mtime which will give you files modified
exactly that number of days ago:

find . -mtime 7 -print

This is simpler, but you'll have to know the number of days ago you need.
For example, today is April 7th. March 31st is 7 days ago.

--
David Weintraub                    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
System Configuration Management   _/                                      _/
Dow Jones/Telerate - NSG         _/    I AM THE GREAT AND POWERFUL OZ*   _/


                           *Pay no attention to the man behind the curtains

 
 
 

"find" command to find file on specific date?

Post by Dave Bro » Tue, 09 Apr 1996 04:00:00






:
: > Hi,
: >    Does anyone please tell me that the find command can be used to find
: file on specific date?
: > For instance: find . -date 960331 -print
:
: I cheat and simply create a file:
:
: touch 960331 /tmp/foo       #Assumes midnight of March 31st.

This creates a file called 960331 in addition to /tmp/foo.

You meant to say 'touch -d 960331 /tmp/foo'

--Dave
--
http://www.csclub.uwaterloo.ca/~dagbrown/ Dave Brown (INTP), Official CSC BOFH
        "Japan, you take over the world until I get back."  --Squawkbox