getting a list of open files versus PID nos.?

krad kraduk at gmail.com
Thu Dec 9 11:49:39 UTC 2010


On 9 December 2010 00:20, Andriy Gapon <avg at freebsd.org> wrote:

> on 09/12/2010 01:47 Matthew Fleming said the following:
> > On Wed, Dec 8, 2010 at 3:01 PM, Bruce Cran <bruce at cran.org.uk> wrote:
> >> On Wed, 8 Dec 2010 14:54:57 -0800
> >> Matthew Fleming <mdf356 at gmail.com> wrote:
> >>
> >>> This is what lsof is for.  I believe there's one in ports, but I have
> >>> never tried it.
> >>
> >> Is there any advantage to using lsof instead of fstat(1) (fstat -p pid)?
> >
> > I believe that lsof reports on all open files by all processes,
> > whereas fstat will only report on a specific provided pid.
>
> Just try running fstat without any options.
> Or procstat -a -f.
>
> --
> Andriy Gapon
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>


not sure if dtrace is ready for it on freebsd yet, but it certainly can do
it on solaris


More information about the freebsd-hackers mailing list