Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Oct 1999 10:39:58 -0700
From:      "David O'Brien" <obrien@NUXI.com>
To:        Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Cc:        current@FreeBSD.ORG
Subject:   Re: lsof + namecache
Message-ID:  <19991028103958.A53305@dragon.nuxi.com>
In-Reply-To: <199910281554.LAA91800@khavrinen.lcs.mit.edu>
References:  <Pine.BSF.4.10.9910270959400.29073-100000@picnic.mat.net> <312.941094594@critter.freebsd.dk> <199910281452.KAA91520@khavrinen.lcs.mit.edu> <19991028085402.A47498@dragon.nuxi.com> <199910281554.LAA91800@khavrinen.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
> > fstat(1) does not have the functionality (that is now missing) that
> > people have come to expect from LSOF.
> ...which is?

Say for instance I want to know which program someone is running (and
what libs it is using).  fstat does not show the path to the program:

obrien   communicator-4.7 84460 root /             2 drwxr-xr-x    1536 r
obrien   communicator-4.7 84460   wd /files   500011 drwx--x--x    9728 r
obrien   communicator-4.7 84460 text /         72712 -r-xr-xr-x  13234176 r
....

vs. LSOF:

communica 82769 obrien  txt   VREG  13,131072   13234176   72712
     /usr/local/lib/netscape/communicator-4.7.us.bin
communica 82769 obrien  txt   VREG  13,131072      77824   87630
    /usr/libexec/ld.so
communica 82769 obrien  txt   VREG  13,131072     292041  143092
    /usr/X11R6/lib/aout/libXt.so.6.0
communica 82769 obrien  txt   VREG  13,131072      79896  143093
    /usr/X11R6/lib/aout/libXmu.so.6.0
...


Both tools are useful.  As Vic Abell has said:

    I think lsof and fstat have gradually converged.  Each delivers some
    information the other doesn't but both deliver the same essential
    information.

    Probably the most important thing in lsof's favor is that it provides
    consistent support across multiple UNIX dialects -- Linux, NetBSD,
    OpenBSD, AIX, HP-UX, SCO OSR, SCO Unixware, and Sun Solaris to name a
    few.  Lsof might have a richer set of command option filters than
    fstat, and it has an output mode designed for use by post processing
    scripts and filters.

-- 
-- David    (obrien@NUXI.com)


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991028103958.A53305>