All rights reserved.
Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by the University of California, Berkeley. The name of the
University may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@(#)fstat.1 5.8 (Berkeley) 10/04/90
Options:
6 -u Report all files open by the specified user.
6 -p Report all files open by the specified process.
6 -f If additional filename arguments are present, restrict to files that are open in the same filesystem as the named file arguments. For example, to find all files open in the filesystem that the directory "/usr/src" resides in, type "fstat -f /usr/src".
6 -n Numerical format. Print the device number (maj,min) of the filesystem the file resides in rather than the mount point name; for special files, print the device number that the special device refers to rather than the filename in /dev; and print the mode of the file in octal instead of symbolic form.
6 -v Verbose mode. Print error messages upon failures to locate particular system data structures rather than silently ignoring them. Most of these data structures are dynamically created and deleted and it is possible for them to disappear while fstat is running. This is normal and unavoidable since the rest of the system is running while fstat itself is running.
6 filename... Restrict reports to the specified files.
The following fields are printed:
6 USER The username of the owner of the process (effective uid).
6 CMD The command name of the process.
6 PID The process id.
6 FD The file number in the per-process open file table or one of the following special names:
text - pure text inode wd - current working directory root - root inode tr - kernel trace fileIf the file number is followed by an asterisk (``*''), the file is not an inode, but rather a socket, FIFO, or there is an error. In this case the remainder of the line doesn't correspond to the remaining headers -- the format of the line is described later under "Sockets".
6 MOUNT If the -n flag wasn't specified, this header is present and is the pathname that the filesystem the file resides in is mounted on.
6 DEV If the -n flag is specified, this header is present and is the major/minor number of the device that this file resides in.
6 INUM The inode number of the file.
6 MODE The mode of the file. If the -n flag isn't specified, the mode is printed using a symbolic format (see strmode(3)); otherwise, the mode is printed as an octal number.
6 SZ|DV If the file is not a character or block special, prints the size of the file in bytes. Otherwise, if the -n flag is not specified, prints the name of the special file as located in /dev. If that cannot be located, or the -n flag is specified, prints the major/minor device number that the special device refers to.
6 NAME If filename arguments are specified and the -f flag is not, then this field is present and is the name associated with the given file. Normally the name cannot be determined since there is no mapping from an open file back to the directory entry that was used to open that file. Also, since different directory entries may reference the same file (via ln(2)), the name printed may not be the actual name that the process originally used to open that file.
For example, the addresses mentioned above are the addresses which the ``netstat -A'' command would print for tcp, udp, and unixdomain. Note that since pipes are implemented using sockets, a pipe appears as a connected unix domain stream socket. A unidirectional unix domain socket indicates the direction of flow with an arrow (``<-'' or ``->''), and a full duplex socket shows a double arrow (``<->'').