GNU Info

Info Node: (find.info)Comparing Timestamps

(find.info)Comparing Timestamps


Prev: Age Ranges Up: Time
Enter node , (file) or (file)node

Comparing Timestamps
--------------------

   As an alternative to comparing timestamps to the current time, you
can compare them to another file's timestamp.  That file's timestamp
could be updated by another program when some event occurs.  Or you
could set it to a particular fixed date using the `touch' command.  For
example, to list files in `/usr' modified after February 1 of the
current year:

     touch -t 02010000 /tmp/stamp$$
     find /usr -newer /tmp/stamp$$
     rm -f /tmp/stamp$$

 - Test: -anewer file
 - Test: -cnewer file
 - Test: -newer file
     True if the file was last accessed (or its status changed, or it
     was modified) more recently than FILE was modified.  These tests
     are affected by `-follow' only if `-follow' comes before them on
     the command line.  Note: Symbolic Links, for more information on
     `-follow'.  As an example, to list any files modified since
     `/bin/sh' was last modified:

          find . -newer /bin/sh

 - Test: -used n
     True if the file was last accessed N days after its status was
     last changed.  Useful for finding files that are not being used,
     and could perhaps be archived or removed to save disk space.


automatically generated by info2www version 1.2.2.9