Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm debugging the initialization of a program (on a mac) and would I'd like to get a list of all the files opened during the execution, preferably in time order. Can this be done?

share|improve this question
up vote 5 down vote accepted


And I need some more characters in this box, but I'm not sure what else to say...

share|improve this answer
This does what I want (although the -w option doesn't work). – eaubin Sep 29 '10 at 2:46

You should be able to use lsof.

share|improve this answer
I can use the lsof -r option, but there's no certainty that I'll get the whole set of files opened. – eaubin Sep 29 '10 at 0:33
@eaubin: You might be able to use ktrace. – Dennis Williamson Sep 29 '10 at 0:42
Turns out ktrace isn't available on my machine, but dtrace can do it: sudo dtrace -s /dev/stdin syscall::open*:entry { printf("%s %s", execname, copyinstr(arg0)); } Ctrl-D (from – eaubin Sep 29 '10 at 11:53

Fseventer gives a nice visual representation.[]=org

share|improve this answer

Your Answer


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.