I know that lsof can list all files which are being opened by running processes.

If there is a process, which will open a file and then will be terminated, I don't think I can catch the file that is opened by the process with lsof because the process terminated itself too fast.

So I'm looking for such a tool (named XXX), allowing me to do the thing as below:

XXX ./my_process args

And the output of the command should be like this:


Which means that the my_process opens three files: file1, file2 and file3 while running.


You could use strace:

strace -e trace=open -o trace.log ./my_process args

Not the answer you're looking for? Browse other questions tagged or ask your own question.