DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

fuser(ADM)


fuser -- identify processes using a file or file structure

Synopsis

/usr/sbin/fuser [-[c|f]ku] files | resources [[-] [-[c|f]ku files | resources] . . .

Description

fuser outputs the process IDs of the processes that are using the files or remote resources specified as arguments. Each process ID is followed by one of these letter codes, which identify how the process is using the file:

c
as its current directory.

r
as its root directory, which was set up by the chroot(ADM) command.

o
as an open file.

t
as its text file.
For block special devices with mounted filesystems, processes using any file on that device are listed. For remote resource names, processes using any file associated with that remote resource are reported. For all other types of files (text files, executables, directories, devices, and so on) only the processes using that file are reported.

The following options may be used with fuser:


-c
may be used with files that are mount points for file systems. With that option the report is for use of the mount point and any files within that mounted filesystem.

-f
when this is used, the report is only for the named file, not for files within a mounted filesystem.

-u
the user login name, in parentheses, also follows the process ID.

-k
the SIGKILL signal is sent to each process. Since this option spawns kills for each process, the kill messages may not show up immediately (see kill(C)).
If more than one group of files are specified, the options may be respecified for each additional group of files. A lone dash cancels the options currently in force.

The process IDs are printed as a single line on the standard output, separated by spaces and terminated with a single new line. All other output is written on standard error.

Any user with permission to read /dev/kmem can use fuser. Only a privileged user can terminate another user's process.

Files


/stand/unix
system namelist

/dev/kmem

/dev/mem
system image

Examples


fuser -ku /dev/dsk/1s?
if typed by a user with appropriate privileges, terminates all processes that are preventing disk drive one from being unmounted, listing the process ID and login name of each as it is killed.

fuser -u /etc/passwd
lists process IDs and login names of processes that have the password file open.

fuser -ku /dev/dsk/1s? -u /etc/passwd
executes both of the above examples in a single command line.

fuser -cu /home
if the /dev/dsk/c1d0s9 device is mounted on /home, lists process IDs and login names of processes that are using /dev/dsk/c1d0s9.

References

chroot(ADM), kill(S), mount(ADM), proc(F), ps(C), signal(S)

Notices

If an RFS resource from a pre System V Release 4 server is mounted, fuser can only report on use of the whole filesystem, not on individual files within it. This RFS interface is no longer supported.

Because fuser works with a snapshot of the system image, it may miss processes that begin using a file while fuser is running. Also, processes reported as using a file may have stopped using it while fuser was running. These factors should discourage the use of the -k option.

fuser does not report all possible usages of a file (for example, a mapped file).


© 2007 The Santa Cruz Operation, Inc. All rights reserved
OpenServer 6 and UnixWare (SVR5) HDK - 05 June 2007