LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to check which file is changed in the last few days? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-check-which-file-is-changed-in-the-last-few-days-770967/)

thomas2004ch 11-23-2009 08:03 AM

How to check which file is changed in the last few days?
 
Sometime I do want to know who has changed which file in the last few days.

How? I think 'history' is maybe one way. But there should be other better ways.

pixellany 11-23-2009 08:15 AM

Take a look at the "find" command.
example:
Code:

find . -mmin -1
finds all files in the current directory (and below) that were modified less than 1 minute ago.

"man find" for details

thomas2004ch 11-23-2009 08:28 AM

Quote:

Originally Posted by pixellany (Post 3766690)
Take a look at the "find" command.
example:
Code:

find . -mmin -1
finds all files in the current directory (and below) that were modified less than 1 minute ago.

"man find" for details

This just find out the changed file under current dir. How about find out all the files?

repo 11-23-2009 08:37 AM

Quote:

This just find out the changed file under current dir. How about find out all the files?
Code:

find / -mmin -1

pixellany 11-23-2009 12:59 PM

Quote:

Originally Posted by thomas2004ch (Post 3766707)
This just find out the changed file under current dir. How about find out all the files?

Look at the man page!!!

The full syntax is:
find [options] [path] [expression]

"." (meaning current directory) is only one example of a pathname.

jijawm 11-23-2009 01:22 PM

If I read your question correctly, you also want to know WHO changed a file. I don't believe there is any data on the OS level that would be of much help; you should look at the application level for this kind of info.
That said:
ls -altr
shows in reverse order of data/time when the files have changed, the most recent being at the bottom of the list.
ls -altru
shows in reverse order of data/time when the files have been accessed. Very useful during upgrades for weeding out junk that is never accessed. Under Windows this information is corrupted by anti-virus scanning. Under linux this information is usually corrupted by backup software unless explicitly told to retain the last time accessed.


All times are GMT -5. The time now is 02:36 PM.