Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

fuser - display file users

&pagelevel(4)&pagelevel

The fuser command allows you to display processes using a file or file system.


Syntax


fuser [-c|-f] [-u] [-k] path ...

-c

All processes which use arbitrary files from the file system at the mountpoint path are displayed.

-f

Only those processes are displayed which use the path file themselves (for device files only).

-u

Displays the user ID of the processes found after the process ID.

-k

The processes found are terminated with the SIGKILL signal.

path

File name or file system mount point.

Options -c und -f not specified:

For special device files representing a mounted file system the option -c is set implicitly, for all other files the option -f is set.


For each process found fuser displays:

nnnc(USER)

|  | |  

|  | user ID (to stderr, optional)

|  one or more usage flags (to stderr)

process ID (to stdout)


Usage flag


ccurrent directory
rroot directory
ofile opened for read/write
tfile opened for execution

Example 1

Display users of a file:

# fuser /var/adm/syslog

/var/adm/syslog:       54o

# ps -fTp 54

     UID   PID   TSN  PPID  C    STIME TTY       TIME CMD

    ROOT    54  0606     1  0 05/06/11 ?         0:02 [syslogd]

#

Example 2

Display users of two file systems with user names:

# fuser -cu /opt /home/froede

/opt:      226t(SYSROOT)     240t(SYSROOT)

/home/froede:      628co(FROEDE)
#

Example 3

Display information on all processes using a file system:

# fuser -c /var 2>/dev/null | read PIDLST

# for PID in $PIDLST
> do

> ps -p $PID -o user= -o pid= -o tsn= -o comm=

> done
 SYSROOT   603  07GN in.rlogind

 SYSROOT   226  0653 prngd

 SYSROOT    54  0606 syslogd
  FROEDE   628  07HD sh

 SYSROOT   201  065E cron

 SYSROOT   606  07GR sh

 SYSROOT   625  07HA in.rlogind
#

The process IDs concerned are read into the PIDLST variable, display of the usage flags (stderr) being suppressed. The process IDs are then processed further in the for loop.