I'm wondering if anyone knows how to log all files that I open with my Mac. I suppose this would be something like a keylogger - but I just want a record of the files that I open by day. I don't want/need every system file that an app references, just the data files - .doc, .psd, .ai, etc....

I struggle with keeping track of my hours sometimes on projects and it would be helpful to be able to go back to a day to see what files I was working on.

Anyone have any ideas?


No a keylogger will only perform a logging of the key you type on your keyboard.

To log all files you open you need a kernel trace function, which will report every open system call. This function is provided by the command dtrace on MacOS X.

The command opensnoop is a shell script based on dtrace and performing exactly what you are looking for.

I advise you to start by using it in its basic mode:

/usr/bin/sudo opensnoop

And then refine it with the use of grep to eliminate file you are not interested in surveying:

/usr/bin/sudo opensnoop | grep -v /System

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .