Ubuntu Logs and Monitoring
-
29-09-2019 - |
Question
I am writing simple program for my Ubuntu 10.04. I want to see which files were used by processes. Where I can see what file was requested by the process?
Solution
I don't know of any log files which list past files that had been opened by a process but I know of a couple ways to determine what files a process opens.
Using strace (system call trace) you can find out what files a program opens:
strace -e trace=open <path_to_executable>
You could also try using lsof (list open files) to determine what files are currently open by running processes.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow