From owner-freebsd-hackers Mon Mar 27 12:00:25 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id MAA03025 for hackers-outgoing; Mon, 27 Mar 1995 12:00:25 -0800 Received: from gvr.win.tue.nl (root@gvr.win.tue.nl [131.155.210.19]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id MAA03018 for ; Mon, 27 Mar 1995 12:00:21 -0800 Received: by gvr.win.tue.nl (8.6.10/1.53) id VAA05009; Mon, 27 Mar 1995 21:59:21 +0200 From: guido@gvr.win.tue.nl (Guido van Rooij) Message-Id: <199503271959.VAA05009@gvr.win.tue.nl> Subject: Re: lsof ported? To: joerg_wunsch@uriah.heep.sax.de Date: Mon, 27 Mar 1995 21:59:20 +0200 (MET DST) Cc: freebsd-hackers@FreeBSD.org In-Reply-To: <199503271735.TAA16197@uriah.heep.sax.de> from "J Wunsch" at Mar 27, 95 07:35:27 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 2139 Sender: hackers-owner@FreeBSD.org Precedence: bulk J Wunsch wrote: > > As Guido van Rooij wrote: > > > > There is this handy program that lists all open file descriptors > > called lsof. It not only lists all open inodes but sockets as well. > > ...exactly what fstat(1) is doing. So why another program? > Fstat does: USER CMD PID FD MOUNT INUM MODE SZ|DV R/W guido tcsh 4954 19* unix stream f061f494 guido vi 4953 10* unix stream f05ea514 <-> f05ed394 guido telnet 4766 3* internet stream tcp f05b1700 guido telnet 4689 3* internet stream tcp f062ad00 root inetd 130 12* internet stream tcp f05d0200 root inetd 130 13* internet stream tcp f059e000 root inetd 130 14* internet stream tcp f05a0e00 root sendmail 127 4* internet stream tcp f05c9200 root nfsd 112 3* internet stream tcp f05c9700 (a smal sample). Lsof does: syslogd 37 root 4u inet 0xf08cf814 0x0 UDP *:syslog portmap 58 root 3u inet 0xf08cf394 0x0 UDP *:sunrpc portmap 58 root 4u inet 0xf0a90214 0x0 TCP *:sunrpc gated 60 root 7u inet 0xf0aafa94 0x0 UDP *:0 gated 60 root 9u inet 0xf0abb380 0x0 ICMP gated 60 root 11u inet 0xf0abb294 0x0 UDP *:route named 62 root 4u inet 0xf0aafc14 0x0 TCP *:domain named 62 root 5u inet 0xf0abb914 0x0 UDP iaehv.IAEhv.nl :domain named 62 root 6u inet 0xf0abb814 0x0 UDP localhost.IAEh v.nl:domain named 62 root 7u inet 0xf0abb714 0x0 UDP iaehv.IAEhv.nl :domain named 62 root 8u inet 0xf0abb614 0x0 UDP iaehv.IAEhv.nl :domain named 62 root 9u inet 0xf0abb514 0x0 UDP *:domain lpd 65 root 5u inet 0xf08d4194 0x0 TCP *:printer sendmail 69 root 5u inet 0xf0935f94 0x0 TCP *:smtp Now...I prefer the second one. Besides, lsof has a bunch of options (among others to only list open network files). -Guido