[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 2

fuser Command

Purpose

Identifies processes using a file or file structure.

Syntax

fuser -c ] [ -f ] [ -k ] [ -u ] File ...

Description

The fuser command lists the process numbers of local processes that use the local or remote files specified by the File parameter. For block special devices, the command lists the processes that use any file on that device.

Each process number is followed by a letter indicating how the process uses the file:

c Uses the file as the current directory.
p Uses the file as the parent of the current directory (only when in use by the system).
r Uses the file as the root directory.

The process numbers are written to standard output in a line with spaces between process numbers. The line ends with a single new-line character. All other output is written to standard error.

Flags

-k Sends the SIGKILL signal to each local process. Only the root user can kill a process of another user.
-u Provides the login name for local processes in parentheses after the process number.
-c Reports on any open files in the file system containing File.

Note:The -c and -f flags apply to AIX Version 4.3 and later releases.

-f Reports on open instances of File only.

Note:The -c and -f flags apply to AIX Version 4.3 and later releases.

You can enter changes in the flag specification for groups of files on the command line. The new set of flags replaces the old set.

Examples

  1. To list the process numbers of local processes using the /etc/passwd file, enter:
    fuser /etc/passwd
  2. To list the process numbers and user login names of processes using the /etc/filesystems file, enter:
    fuser -u /etc/filesystems
  3. To terminate all of the processes using a given file system, enter:
    fuser -k -u /dev/hd1
    This command lists the process number and user name, and then terminates each process that is using the /dev/hd1 file system. Only the root user can terminate processes that belong to another user. You might want to use this command if you are trying to unmount the /dev/hd1 file system and a process that is accessing the /dev/hd1 file system prevents this.
  4. To terminate each process that is using the /dev/hd1 file system and then list the process numbers and user name (the previous example in reverse order), enter:
    fuser -k -u /dev/hd1 -u /etc/filesystems /etc/passwd

Files

/dev/kmem Used for the system image.
/dev/mem Also used for the system image.

Related Information

The killall command, mount command, ps command.

For more information about the identification and authentication of users, discretionary access control, the trusted computing base, and auditing, refer to Security Administration in AIX Version 4.3 System Management Guide: Operating System and Devices.


[ Previous | Next | Contents | Glossary | Home | Search ]