How can I find out which user or process has a file open or is using

How can I find out which user or process has a file open or is using


Use fuser (system V), fstat (BSD), ofiles (public domain) or
pff (public domain). These programs will tell you various things
about processes using particular files.

A port of the 4.3 BSD fstat to Dynix, SunOS and Ultrix
can be found in archives of comp.sources.unix, volume 18.

pff is part of the kstuff package, and works on quite a few systems.
Instructions for obtaining kstuff are provided in question 3.10.

I've been informed that there is also a program called lsof. I
don't know where it can be obtained.

Michael Fink adds:

If you are unable to unmount a file system for which above tools
do not report any open files make sure that the file system that
you are trying to unmount does not contain any active mount
points (df(1)).



Home FAQ