opensnoop - snoop file opens as they occur. Uses DTrace.
opensnoop [-a|-A|-ceFghstvxZ] [-f pathname] [-n name] [-p PID]
opensnoop tracks file opens. As a process issues a file open, details such as UID, PID and pathname are printed out.
The returned file descriptor is printed, a value of -1 indicates an error. This can be useful for troubleshooting to determine if applications are attempting to open files that do not exist.
Since this uses DTrace, only users with root privileges can run this command.
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with verbose descriptions explaining the output.
opensnoop will run forever until Ctrl-C is hit.
occasionally the pathname for the file open cannot be read and the following error will be seen,
dtrace: error on enabled probe ID 6 (...): invalid address
this is normal behaviour.
Brendan Gregg [Sydney, Australia]
|January 12, 2006||version 1.60|