truss - trace system calls and signals


truss [-DhpR] [-S nsteps] [-o outfile] [--] arg ...


The truss(1) utility traces system calls and signals while it runs. Unless the -o option is given, these are written to standard error. You must specify one or more args. Normally, the arg is the argument vector of a command to trace. If the -p option is given, you can supply a list of process identifiers (IDs) as the args.

The truss(1) takes the following options:

Generate debug.
Display help information.
-o file
Write output into file; without this option, output is written to standard error.
Print information only about certain processes; processes are specified as process IDs.
Dump registers on each event.
-S n
Single step for n computer instructions.


The truss(1) utility exits with status 0 for success, and >0 if an error occurred.


To follow the system calls for an ls(1) command:

$ truss ls /bin/truss
tracing pid 8323077
isatty(1) isatty returned 0
ioctl() ioctl returned 0
getids() getids returned 0
stat() stat returned 0
fstat(1, 0x2540588) fstat returned 0
isatty(1) isatty returned 0
isatty(1) isatty returned 0
write(1, 0x830C60, 22) /bin/truss
write returned 22 0x16
exit(0) process has exited
In this case, all calls returned 0.