strace
can monitor only one single processes not all, lsof
is not a good way too, it's not a real time tool, maybe I need a real time version of lsof
? How to list all the processes which have accessed a particular file?
Asked
Active
Viewed 657 times
1

semuci
- 11
1 Answers
2
You can use fanotify(7)
. It's similar to inotify, but it tells you the PID of the accessing process.
-
I forget to tell you I have only one suspicious program running on my Linux needs to be monitored, will the program call other "normal" programs for the access? – semuci Sep 29 '18 at 10:25
-
Issue following in command prompt respectively auditctl -w /path/to/afil.txt tail -f /var/log/audit/audit.log When I open afil.txt, /var/log/audit/audit.log has no change, audit.log get refreshed if I move afil.txt to Trash, but not the huge number of things as they said, is that any mistake in my issue? – semuci Sep 29 '18 at 13:04
auditd
(not for the faint-hearted) orinotify
. – doneal24 Sep 27 '18 at 12:22