Discussion Locked

How to monitor the files accessed by a program (linux)

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,
I need a way to get a list of files that are opened by a simulation in linux. I tried "lsof" which works but it is an instantaneous query. I need something that will continuously monitor a process and when the process ends, report the file IO history.

Does anyone have any ideas?

Thanks,
Wes

2 replies

by wes.kirk

Thanks Choppit! Strace worked for me. I had to add the -f option to pick up the files opened by the child processes also.

strace -e trace=open -o strace.out -f ./compile.csh

This discussion is closed to new replies.