Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to determine which files a process creates when it runs. I know that I can list the file handles of a currently running process by looking in /proc or using lsof. However, the problem is that the program finishes in less than a second. Is there any way I can get the list of files it opened when it ran? I am using CentOS.

share|improve this question
add comment

2 Answers 2

up vote 8 down vote accepted
$ strace -e trace=open /path/to/your/program 2>&1 | less
share|improve this answer
    
Works perfectly, thanks! –  del Jul 29 '11 at 5:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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