System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Unix command to find how to find out the list of files which changed...lastt 5 hours

 
Kadavan
Occasional Advisor

Unix command to find how to find out the list of files which changed...lastt 5 hours

Can any body tell me the command to find
the list of files which changed...lastt 5 hours
1 REPLY
Matti_Kurkela
Honored Contributor

Re: Unix command to find how to find out the list of files which changed...lastt 5 hours

The command to find files is "find", but choosing the proper options for it is a bit tricky.

If you have a recent version of Linux, it has GNU find as standard, and most likely supports the option "-mmin".

This command will find all files that have been modified less than 301 minutes ago (i.e. exactly 5 hours or less).

find / -mmin -301

If your version of Linux or other Unix has an older version of GNU find, or a POSIX standard find, it can only find files newer/older than another file. (The -mtime option is not applicable for finding files changed in last 5 hours, because it works in units of 24 hours.)

In that case, you'll have to create an empty file with a particular time stamp to identify the time you want:

Example:
(current time is 2011-03-15 15:15)

touch -t 201103151014 /tmp/timefile
find / -newer /tmp/timefile

MK
MK