Manual Pages for UNIX Darwin command on man opensnoop
MyWebUniversity

Manual Pages for UNIX Darwin command on man opensnoop

opensnoop(1m) USER COMMANDS opensnoop(1m)

NAME

opensnoop - snoop file opens as they occur. Uses DTrace.

SYNOPSIS

ooppeennssnnoooopp [-a|-A|-ceghsvxZ] [-f pathname] [-n name] [-p PID]

DESCRIPTION

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 applia-

cions are attempting to open files that do not exist. Since this uses DTrace, only the root user or users with the dtracekernel privilege can run this command. OOPPTTIIOONNSS

-a print all data

-A dump all data, space delimited

-c print current working directory of process

-e print errno value

-g print full command arguments

-s print start time, us

-v print start time, string

-x only print failed opens

-Z print zonename

-f pathname

file pathname to snoop

-n name

process name to snoop

-p PID process ID to snoop

EEXXAAMMPPLLEESS Default output, print file opens by process as they occur,

# ooppeennssnnoooopp

Print human readable timestamps,

# ooppeennssnnoooopp -v

See error codes,

# ooppeennssnnoooopp -e

Snoop this file only,

# ooppeennssnnoooopp -f /etc/passwd

FFIIEELLDDSS ZONE Zone name UID User ID PID Process ID PPID Parent Process ID

FD File Descriptor (-1 is error)

ERR errno value (see /usr/include/sys/errno.h) CWD current working directory of process PATH pathname for file open COMM command name for the process ARGS argument listing for the process TIME timestamp for the open event, us STRTIME timestamp for the open event, string DDOOCCUUMMEENNTTAATTIIOONN

See the DTraceToolkit for further documentation under the Docs direc-

tory. The DTraceToolkit docs may include full worked examples with ver-

bose descriptions explaining the output. EEXXIITT

opensnoop will run forever until Ctrl-C is hit.

BUGS

occasionally the pathname for the file open cannot be read and the fol-

lowing error will be seen, dtrace: error on enabled probe ID 6 (...): invalid address this is normal behaviour. AUTHOR Brendan Gregg [Sydney, Australia]

SEE ALSO

dtrace(1M), truss(1)

version 1.60 Jan 12, 2006 opensnoop(1m)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™