(a)
% truss -t open,read,write,close date >/dev/null
...startup system calls skipped...
open("/usr/share/lib/zoneinfo/US/Eastern", O_RDONLY) = 3
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0".., 8192)     = 1250
close(3)                                      = 0
write(1, " M o n   A p r   2 4   1".., 29)     = 29

(b)
strace -p pid -f -e trace=read,write -e read=6 -e write=4

Example 1: (a) Displaying all I/O-related system calls that are made by the Solaris date command after process initialization; (b) putting software crocodile clamps on an ssh server process.

Back to Article