LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Is there any way to tell which user last accessed a file? (https://www.linuxquestions.org/questions/programming-9/is-there-any-way-to-tell-which-user-last-accessed-a-file-493716/)

sixerjman 10-18-2006 11:19 PM

Is there any way to tell which user last accessed a file?
 
I have a script that monitors access to files (using 'stat' to get the access time) but I couldn't find any switches to show the user which performed the access.

I know about 'fuser' and 'lsof' but those commands identify open files
and I just want to check last (completed) access.

Any help would be appreciated. Thanks in advanced! :study: :)

Micro420 10-18-2006 11:30 PM

I suppose you can look at each user's home directory and find their .bash_history file

jlliagre 10-19-2006 01:28 AM

That depend on the O/S.
You'll need some kernel tracing facility.
Under Solaris 10+ or the latest MacOS/X, a simple DTrace script would do the job.
Under Linux, nothing equivalent exists. Simpler experimental ways to explore are KProbes, LTT, DProbes, SystemTraps and probably others.


All times are GMT -5. The time now is 09:28 AM.