16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Description<br />

Option<br />

Usage notes<br />

Examples<br />

The fuser command writes to standard output the process IDs of all processes<br />

running on the local system that have one or more named files open. file is the<br />

pathname of the file for which information is to be reported, or, if the –c options is<br />

used, the pathname of a file on the file system for which information is to be<br />

reported.<br />

The fuser command writes additional information to standard error, such as the<br />

user name of the process and a character indicating how the process is using the<br />

file. fuser only reports on local processes, not remote ones.<br />

–c fuser reports on all open files within the file system that the specified file is<br />

a member of<br />

–f fuser reports on only the named files. This is the default.<br />

–k fuser sends the SIGKILL signal to each local process (with the exception of<br />

the fuser process and parent processes of fuser). Only a superuser can<br />

terminate a process that belongs to another user. This option is a z/<strong>OS</strong><br />

extension.<br />

–u fuser writes to standard error the user name associated with each process<br />

ID written to standard output.<br />

fuser will write the process ID for each process to standard output. fuser also<br />

writes the following to standard error:<br />

v The pathname of each file specified on the command line.<br />

v An indicator of how the process is using this file (written after the process ID):<br />

–c The process is using the file as its current directory.<br />

–r The process is using the file as its root directory.<br />

If no character follows the PID, this means that the process has the file open.<br />

v When the –u option is specified, fuser writes the user name corresponding to the<br />

process’ real user ID.<br />

1. To list the process numbers of local processes using the /etc/magic file, enter:<br />

fuser /etc/magic<br />

which will give you the following output:<br />

/etc/magic: 67109274 144<br />

2. To display the user names associated with the processes accessing the file<br />

/etc/magic:<br />

fuser -u /etc/magic<br />

Your output would be:<br />

/etc/magic: 67109274(Steve) 144(Fred)<br />

3. To terminate all of the processes using a given file system, enter either the<br />

mount point name or the name of a file in that file system:<br />

fuser -ku /u/home<br />

fuser<br />

Chapter 2. Shell command descriptions 291

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!