how to see which files are open?

Bob.Izenberg bei at puzzle.UUCP
Fri Feb 23 14:39:21 AEST 1990


In article <3537 at zorba.Tynan.COM> uunet!unix.sri.com!cole (Susan Cole) writes:
>frustrating.  There must be a way to see what processes have which
>files open...

I don't have the man page for fuser, but here's some of what the book says:
(sharp signs inserted for safety's sake)
# fuser - identify processes using a file or file structure

# /etc/fuser -ku (files) (-) (-ku) (files)

For block special devices, all processes using any file on that device are
listed.
If the -k option is specified, the SIGKILL signal is sent to each process.
(If you have permission to kill it.)
If the -u option is specified, the login name, in parentheses, also follows
the process id.
So, try this:
# su
# /etc/fuser -ku /dev/dsk/c1t1d1s8
# umount /dev/dsk/c1t1d1s8

The fine print qualifies the man page thusly:
The command fuser works with a snapshot of the system table, which is
true only for an instant.  It is possible that other processes begin
accessing the specified file(s) after this snapshot is taken.
Does your machine have fuser?
-- Bob
-- 
 ------------------------------------------------------------------------------
                     Bob Izenberg [ ] Ralph Kirkley Associates
              attctc!puzzle!bei    512 346 7019 (home)    Austin, TX
 ------------------------------------------------------------------------------



More information about the Comp.unix mailing list