Commit | Line | Data |
---|---|---|
d613fe68 MT |
1 | .\" Copyright (c) 1987 Regents of the University of California. |
2 | .\" All rights reserved. | |
3c3ea40f | 3 | .\" |
d613fe68 MT |
4 | .\" Redistribution and use in source and binary forms are permitted |
5 | .\" provided that this notice is preserved and that due credit is given | |
6 | .\" to the University of California at Berkeley. The name of the University | |
7 | .\" may not be used to endorse or promote products derived from this | |
8 | .\" software without specific prior written permission. This software | |
9 | .\" is provided ``as is'' without express or implied warranty. | |
10 | .\" | |
11 | .\" @(#)fstat.1 5.3 (Berkeley) %G% | |
3c3ea40f MT |
12 | .\" |
13 | .TH FSTAT 8 "" | |
14 | .UC 4 | |
15 | .SH NAME | |
16 | fstat \- file status | |
17 | .SH SYNOPSIS | |
18 | .B fstat | |
19 | [ | |
20 | .B \-u | |
21 | user ] [ | |
22 | .B \-p | |
23 | pid ] [ | |
d613fe68 MT |
24 | .B filename... |
25 | ] | |
3c3ea40f MT |
26 | .SH DESCRIPTION |
27 | .I Fstat | |
28 | identifies open files. | |
29 | A file is considered open if a process has it open, | |
30 | if it is the working directory for a process, | |
31 | or if it is an active pure text file. | |
32 | If no options are specified, | |
33 | .I fstat | |
34 | reports on all open files. | |
35 | .PP | |
36 | Options: | |
37 | .TP 6 | |
38 | .B \-u | |
39 | Report all files open by a specified user. | |
40 | .TP 6 | |
41 | .B \-p | |
42 | Report all files open by a specified process id. | |
43 | .TP 6 | |
d613fe68 MT |
44 | .B filename... |
45 | Restrict reports to the specified files. | |
3c3ea40f MT |
46 | If the file is a block special file, |
47 | .I fstat | |
48 | additionally reports on any open files on that device, | |
49 | treating it as a mounted file system. | |
50 | .PP | |
3c3ea40f MT |
51 | The following fields are printed |
52 | .TP 6 | |
53 | .B USER | |
54 | The username of the owner of the process. | |
55 | .TP 6 | |
56 | .B CMD | |
57 | The command name of the process. | |
58 | .TP 6 | |
59 | .B PID | |
60 | The process id. | |
61 | .TP 6 | |
62 | .B FD | |
63 | The file number in the per-process open file table. The special | |
64 | names "text" and "wd" mean that the file is the pure text inode | |
65 | or the working directory for the process. If the file number is | |
66 | followed by an asterick (*), then the file is not an inode, but | |
67 | either a socket, fifo, or has an error of some kind. In this case | |
68 | the rest of the entry is variable format, doesn't correspond | |
69 | to the rest of the | |
70 | headings, and is | |
71 | enclosed in parenthesis. | |
72 | The following paragraph describing sockets will explain the | |
73 | variable format. | |
74 | .TP 6 | |
75 | .B DEVICE | |
76 | Major minor number of the device this file exists on. | |
77 | .TP 6 | |
78 | .B INODE | |
79 | The inode number of the file. | |
80 | .TP 6 | |
81 | .B SIZE | |
82 | The size in bytes of the file. | |
83 | .TP 6 | |
84 | .B TYPE | |
85 | The type of the file. (see stat(2)) | |
86 | .PP | |
87 | Sockets | |
88 | .sp1 6 | |
d613fe68 MT |
89 | The formating of open sockets depends on the protocol domain. In |
90 | all cases the first field is the domain name, the second field | |
3c3ea40f | 91 | is the socket type (stream, dgram, etc), and the third is the socket |
d613fe68 MT |
92 | flags field (in hex). The remaining fields are protocol dependent. For tcp, |
93 | it is the address of the tcpcb, and for udp, | |
94 | the inpcb (socket pcb). For unix domain sockets, its the address of the socket | |
3c3ea40f MT |
95 | pcb and the address of the connected pcb (if connected). Otherwise |
96 | the protocol number and address of the socket itself are printed. The | |
97 | idea is not to duplicate netstat, but to make available enough | |
98 | information for further analysis. For example, the addresses mentioned | |
99 | above are the addresses which the "netstat -A" command would print for | |
100 | tcp, udp, and unixdomain. Note that since pipe(2) is implemented | |
d613fe68 MT |
101 | with sockets, a pipe appears as a connected unix domain stream socket. |
102 | A unidirectional unix domain socket indicates the direction of | |
103 | flow with an arrow ("<-" or "->"), and a full duplex socket shows | |
104 | a double arrow ("<->"). | |
3c3ea40f | 105 | .dt |
d613fe68 MT |
106 | .SH BUGS |
107 | Socket information clutters the output. | |
108 | .PP | |
109 | Since \fIfstat\fP takes a snapshot of the system, it is only correct for | |
110 | a very short period of time. | |
3c3ea40f MT |
111 | .SH "SEE ALSO" |
112 | ps(1), stat(2), pstat(8) |