FUSER(1P)
β¨ fuser(1P) β bestie edition β¨
okay so this is fuser from the POSIX Programmer's Manual π
and it lives in section 1P. come sit with me, we're gonna go through the whole thing together, no skipping π«Ά
πΈ PROLOG πΈ
okay so heads up before literally anything else: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ β so if you're on Linux, go check the corresponding Linux manual page for the deets on Linux behavior. orrrr the interface might not even be implemented on Linux at all π. vibe check accordingly.
π NAME π
fuser β list process IDs of all processes that have one or more files open. that's it, that's the whole job. it's giving detective energy π
π SYNOPSIS π
fuser [-cfu] file...
three little flags, infinite possibilities. slay.
π¦ DESCRIPTION π¦
okay so here's the tea β the fuser utility shall write to standard output the process IDs of processes running on the local system that have one or more named files open.
and bestie, for block special devices, all processes using any file on that device are listed. not just the device itself, the whole device. iconic behavior honestly.
the fuser utility shall write to standard error additional information about the named files, indicating how the file is being used. so stdout gets you the IDs, stderr gets you the gossip about what they're doing with the file π
any output for processes running on remote systems that have a named file open? unspecified. we simply do not know, and the standard is not going to speculate π
also β a user may need appropriate privileges to invoke the fuser utility. so if it's not working, that might be why. just saying.
β¨ OPTIONS β¨
first things first: the fuser utility shall conform to the Base Definitions volume of POSIX.1β2017, Section 12.2, Utility Syntax Guidelines. very official, very demure.
the following options shall be supported:
-cβ the file is treated as a mount point, and the utility shall report on any files open in the file system. whole filesystem sweep, not just the one file. main character energy.-fβ the report shall be only for the named files. no extras, no plus-ones, just the files you named. periodt.-uβ the user name, in parentheses, associated with each process ID written to standard output shall be written to standard error. so you get names with your numbers π«Ά
π OPERANDS π
the following operand shall be supported:
fileβ a pathname on which the file or file system is to be reported.
that's the one. that's the whole list.
π STDIN π
Not used. she does not read from stdin, she's not listening, she doesn't want your input π
π INPUT FILES π
The user database.
(that's the whole thing. the user database. that's where the usernames for -u come from, iykyk)
π§ ENVIRONMENT VARIABLES π§
the following environment variables shall affect the execution of fuser:
LANGβ provide a default value for the internationalization variables that are unset or null. (see the Base Definitions volume of POSIX.1β2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)LC_ALLβ if set to a non-empty string value, override the values of all the other internationalization variables. she's the boss, she overrules everybody πLC_CTYPEβ determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).LC_MESSAGESβ determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.NLSPATHβ determine the location of message catalogs for the processing ofLC_MESSAGES.
β ASYNCHRONOUS EVENTS β
Default.
translation: nothing special happens here, standard behavior only, moving on π
π STDOUT π
the fuser utility shall write the process ID for each process using each file given as an operand to standard output in the following format:
"%d", <process_id>
that's the exact format, bestie. %d and the process ID. copy it character for character, don't get creative π
π₯ STDERR π₯
the fuser utility shall write diagnostic messages to standard error.
the fuser utility also shall write the following to standard error:
- The pathname of each named file is written followed immediately by a
<colon>. - For each process ID written to standard output, the character
'c'shall be written to standard error if the process is using the file as its current directory, and the character'r'shall be written to standard error if the process is using the file as its root directory. Implementations may write other alphabetic characters to indicate other uses of files. - When the
-uoption is specified, characters indicating the use of the file shall be followed immediately by the user name, in parentheses, corresponding to the real user ID of the process. If the user name cannot be resolved from the real user ID of the process, the real user ID of the process shall be written instead of the user name. so worst case you still get something, just a number instead of a name π«Ά
when standard output and standard error are directed to the same file, the output shall be interleaved so that the filename appears at the start of each line, followed by the process ID and characters indicating the use of the file. Then, if the -u option is specified, the user name or user ID for each process using that file shall be written.
a <newline> shall be written to standard error after the last output described above for each file operand. one last little line break, as a treat πΈ
π OUTPUT FILES π
None.
she writes to stdout and stderr and that's it, she's not out here creating files, she's too busy π
π¦ EXTENDED DESCRIPTION π¦
None.
no extended description, no secret bonus chapter, nothing. we're done here.
π EXIT STATUS π
the following exit values shall be returned:
0β Successful completion. ate and left no crumbs β¨>0β An error occurred. π
π CONSEQUENCES OF ERRORS π
Default.
the following sections are informative. (so like, helpful context, not the legally binding stuff. still useful though, don't skip.)
π APPLICATION USAGE π
None.
π EXAMPLES π
okay bestie, example time, this is the part where it all clicks π«Ά
the command:
fuser -fu .
writes to standard output the process IDs of processes that are using the current directory, and writes to standard error an indication of how those processes are using the directory and the user names associated with the processes that are using the current directory.
fuser -c <mount point>
writes to standard output the process IDs of processes that are using any file in the file system which is mounted on <mount point>, and writes to standard error an indication of how those processes are using the files.
fuser <mount point>
writes to standard output the process IDs of processes that are using the file which is named by <mount point>, and writes to standard error an indication of how those processes are using the file.
(spot the difference? -c = whole filesystem, no -c = just that one path. lowkey the most important distinction on this whole page π)
fuser <block device>
writes to standard output the process IDs of processes that are using any file which is on the device named by <block device>, and writes to standard error an indication of how those processes are using the file.
fuser -f <block device>
writes to standard output the process IDs of processes that are using the file <block device> itself, and writes to standard error an indication of how those processes are using the file.
so -f says "just the file, not everything on the device." obsessed with the restraint honestly π
π§ RATIONALE π§
the definition of the fuser utility follows existing practice.
that's the whole rationale. she's not reinventing anything, she's just doing what everybody already does. no cap.
β FUTURE DIRECTIONS β
None.
π SEE ALSO π
- The Base Definitions volume of POSIX.1β2017, Chapter 8, Environment Variables
- Section 12.2, Utility Syntax Guidelines
π COPYRIGHT π
portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group.
in the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. the original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. to report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
okay that's the whole page bestie, we made it π«Ά this was brought to you by IEEE/The Open Group, 2017, and the letter f. now go fuser something responsibly, and remember: stdout for the process IDs, stderr for the drama πβ¨π
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms