Unix How To: Peering at a Process with lsof

By  

We can also scan through the lines of output and see that it's using ports 32779 (UDP) and 32772 (TCP), both running IPv4.

bash-2.03# lsof -n -c ypbind
COMMAND PID USER   FD   TYPE        DEVICE SIZE/OFF   NODE NAME
ypbind  198 root  cwd   VDIR         136,0     2048      2 /
ypbind  198 root  txt   VREG         136,0    36256 115560 /usr/lib/netsvc/yp/ypbind
ypbind  198 root  txt   VREG         136,0  1158072 269602 /usr/lib/libc.so.1
ypbind  198 root  txt   VREG         136,0    13184 269407 / (/dev/dsk/c0t2d0s0)
ypbind  198 root  txt   VREG         136,0   919956 269353 /usr/lib/libnsl.so.1
ypbind  198 root  txt   VREG         136,0    17096 473904 /usr/platform/sun4u/lib/libc_psr.so.1
ypbind  198 root  txt   VREG         136,0    24968 269369 /usr/lib/libmp.so.2
ypbind  198 root  txt   VREG         136,0     5008 269399 /usr/lib/libdl.so.1
ypbind  198 root  txt   VREG         136,0   266140 269361 /usr/lib/ld.so.1
ypbind  198 root    0r  VCHR          13,2      0t0 864205 /devices/pseudo/mm@0:null
ypbind  198 root    1w  VCHR          13,2      0t0 864205 /devices/pseudo/mm@0:null
ypbind  198 root    2w  VCHR          13,2      0t0 864205 /devices/pseudo/mm@0:null
ypbind  198 root    3ww VREG         136,0        4 966677 /var/yp/binding/ypbind.pid
ypbind  198 root    4u  IPv4 0x3000015a4b0      0t0    UDP *:32779 (Idle)
ypbind  198 root    5ww VREG         136,0       15 966840 /var/yp/binding/xprt.udp.3
ypbind  198 root    6ww VREG         136,0       15 966841 /var/yp/binding/xprt.udp.2
ypbind  198 root    7ww VREG         136,0       15 966842 /var/yp/binding/xprt.udp.1
ypbind  198 root    8u  IPv4 0x3000015a030      0t0    TCP *:32772 (LISTEN)
ypbind  198 root    9ww VREG         136,0       14 966848 / (/dev/dsk/c0t2d0s0)
ypbind  198 root   10ww VREG         136,0       14 966849 / (/dev/dsk/c0t2d0s0)
ypbind  198 root   11ww VREG         136,0       14 966850 /var/yp/binding/xprt.tcp.1
ypbind  198 root   12u  VCHR        105,19      0t0 864213 /devices/pseudo/tl@0:ticots->timod->tl
ypbind  198 root   13ww VREG         136,0       14 966851 / (/dev/dsk/c0t2d0s0)
ypbind  198 root   14ww VREG         136,0       14 967065 / (/dev/dsk/c0t2d0s0)
ypbind  198 root   15ww VREG         136,0       14 967066 / (/dev/dsk/c0t2d0s0)
ypbind  198 root   16u  VCHR        105,20      0t0 864213 /devices/pseudo/tl@0:ticots->timod->tl
ypbind  198 root   17ww VREG         136,0       14 967067 /var/yp/binding/xprt.ticotsord.3
ypbind  198 root   18ww VREG         136,0       14 967077 /var/yp/binding/xprt.ticotsord.2
ypbind  198 root   19ww VREG         136,0       14 967079 /var/yp/binding/xprt.ticotsord.1
ypbind  198 root   20u  VCHR        105,21      0t0 864213 /devices/pseudo/tl@0:ticots->timod->tl
ypbind  198 root   21ww VREG         136,0       14 967080 /var/yp/binding/xprt.ticots.3
ypbind  198 root   22ww VREG         136,0      140  44801 / -- cache_binding

The FD and TYPE columns in this out

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

Ask a Question