|FSTAT(1)||General Commands Manual||FSTAT(1)|
fstatidentifies open files. A file is considered open by a process if it was explicitly opened, is the working directory, root directory, active executable text, or kernel trace file for that process. If no options are specified,
fstatreports on all open files in the system. The options are as follows:
# fstat -f /usr/src
fstatis running. This is normal and unavoidable since the rest of the system is running while
fstatitself is running.
text - executable text inode wd - current working directory root - root inode tr - kernel trace file
*’), the file is not an inode, but rather a socket, 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.
-nflag wasn't specified, this header is present and is the pathname that the file system the file resides in is mounted on.
-nflag is specified, this header is present and is the major/minor number of the device that this file resides in.
*’) if the inode is unlinked from disk.
-nflag isn't specified, the mode is printed using a symbolic format (see strmode(3)); otherwise, the mode is printed as an octal number.
r Open for reading w Open for writing e close-on-exec flag is set
-nflag is not specified, prints the name of the special file as located in /dev. If that cannot be located, or the
-nflag is specified, prints the major/minor device number that the special device refers to.
-fflag 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(1)), the name printed may not be the actual name that the process originally used to open that file.
netstat -Acommand would print for TCP, UDP, and UNIX-domain. A unidirectional UNIX-domain socket indicates the direction of flow with an arrow (“<-” or “->”), and a full duplex socket shows a double arrow (“<->”). For
fstatalso attempts to print the internet address and port for the local end of a connection. If the socket is connected, it also prints the remote internet address and port. A ‘
*’ is used to indicate an
INADDR_ANYbinding. In this case, the use of the arrow (“<--” or “-->”) indicates the direction the socket connection was created. If the socket has been spliced to or from another socket (see setsockopt(2) and
fstatprints a thick arrow (“<==>”, “<==”, or “==>”), followed by the address and endpoint information of the other socket in the splice, if available. kqueue(2) is printed with some information as to queue length. Since these things are normally serviced quickly, it is likely that nothing of real importance can be discerned. netstat(1), nfsstat(1), ps(1), systat(1), top(1), iostat(8), pstat(8), tcpdrop(8), vmstat(8)
fstatcommand appeared in 4.3BSD-Tahoe. nfsd(8), will not be seen by
fstat, even though they appear in netstat(1).
fstattakes a snapshot of the system, it is only correct for a very short period of time. Moreover, because DNS resolution and YP lookups cause many file descriptor changes,
fstatdoes not attempt to translate the internet address and port numbers into symbolic names.
|January 21, 2017||OpenBSD-6.1|