AIX 5.[123] Apple Darwin 7.x and 8.x for Power Macintosh systems BSDI BSD/OS 4.3.1 for x86-based systems FreeBSD 4.x, 4.1x, 5.x and [67].x for x86-based systems FreeBSD 5.x and [67].x for Alpha, AMD64 and Sparc64-based systems HP-UX 11.00, 11.11 and 11.23 Linux 2.1.72 and above for x86-based systems NetBSD 1.[456], 2.x and 3.x for Alpha, x86, and SPARC-based systems NEXTSTEP 3.[13] for NEXTSTEP architectures OpenBSD 2.[89] and 3.[01234567] for x86-based systems OPENSTEP 4.x SCO OpenServer Release 5.0.6 for x86-based systems SCO|Caldera UnixWare 7.1.4 for x86-based systems Solaris 2.6, 8, 9 and 10 Tru64 UNIX 5.1
b the regular expression is a basic one. i ignore the case of letters. x the regular expression is an extended one (default).See the lsof FAQ (The FAQ section gives its location.) for more information on basic and extended regular expressions. The simple command specification is tested first. If that test fails, the command regular expression is applied. If the simple command test succeeds, the command regular expression test isn't made. This may result in ``no command found for regex:'' messages when lsof's -V option is specified.
? - report device cache file paths b - build the device cache file i - ignore the device cache file r - read the device cache file u - read and update the device cache fileThe b , r , and u functions, accompanied by a path name, are sometimes restricted. When these functions are restricted, they will not appear in the description of the -D option that accompanies -h or -? option output. See the DEVICE CACHE FILE section and the sections that follow it for more information on these functions and when they're restricted. The ? function reports the read-only and write paths that lsof can use for the device cache file, the names of any environment variables whose values lsof will examine when forming the device cache file path, and the format for the personal device cache file path. (Escape the `?' character as your shell requires.) When available, the b , r , and u functions may be followed by the device cache file's path. The standard default is .lsof_hostname in the home directory of the real user ID that executes lsof , but this could have been changed when lsof was configured and compiled. (The output of the -h and -? options show the current default prefix - e.g., ``.lsof''.) The suffix, hostname , is the first component of the host's name returned by gethostname(2) . When available, the b function directs lsof to build a new device cache file at the default or specified path. The i function directs lsof to ignore the default device cache file and obtain its information about devices via direct calls to the kernel. The r function directs lsof to read the device cache at the default or specified path, but prevents it from creating a new device cache file when none exists or the existing one is improperly structured. The r function, when specified without a path name, prevents lsof from updating an incorrect or outdated device cache file, or creating a new one in its place. The r function is always available when it is specified without a path name argument; it may be restricted by the permissions of the lsof process. When available, the u function directs lsof to read the device cache file at the default or specified path, if possible, and to rebuild it, if necessary. This is the default device cache file function when no -D option has been specified.
$ lsof +f -- /file/system/name $ lsof -f -- /file/nameThe listing of information from kernel file structures, requested with the +f [cfgGn] option form, is normally inhibited, and is not available for some dialects - e.g., /proc-based Linux. When the prefix to f is a plus sign (`+'), these characters request file structure information:
cWhen the prefix is minus (`-') the same characters disable the listing of the indicated values. File structure addresses, use counts, flags, and node addresses may be used to detect more readily identical files inherited by child processes and identical files in use by different processes. Lsof column output can be sorted by output columns holding the values and listed to identify identical file use, or lsof field output can be parsed by an AWK or Perl post-filter script, or by a C program.file structure use count ffile structure address gfile flag abbreviations Gfile flags in hexadecimal nfile structure node address
46 specifies the IP version, IPv4 or IPv6 that applies to the following address. '6' may be be specified only if the UNIX dialect supports IPv6. If neither '4' nor '6' is specified, the following address applies to all IP versions. protocol is a protocol name - TCP or UDP. hostname is an Internet host name. Unless a specific IP version is specified, open network files associated with host names of all versions will be selected. hostaddr is a numeric Internet IPv4 address in dot form; or an IPv6 numeric address in colon form, enclosed in brackets, if the UNIX dialect supports IPv6. When an IP version is selected, only its numeric addresses may be specified. service is an /etc/services name - e.g., smtp - or a list of them. port is a port number, or a list of them.IPv6 options may be used only if the UNIX dialect supports IPv6. To see if the dialect supports IPv6, run lsof and specify the -h or -? (help) option. If the displayed description of the -i option contains ``[46]'' and ``IPv[46]'', IPv6 is supported. IPv4 host names and addresses may not be specified if network file selection is limited to IPv6 with -i " 6." IPv6 host names and addresses may not be specified if network file selection is limited to IPv4 with -i " 4." When an open IPv4 network file's address is mapped in an IPv6 address, the open file's type will be IPv6, not IPv4, and its display will be selected by '6', not '4'. At least one address component - 4, 6, protocol , ,IR hostname , hostaddr , or service - must be supplied. The `@' character, leading the host specification, is always required; as is the `:', leading the port specification. Specify either hostname or hostaddr . Specify either service name list or port number list. If a service name list is specified, the protocol may also need to be specified if the TCP and UDP port numbers for the service name are different. Use any case - lower or upper - for protocol . Service names and port numbers may be combined in a list whose entries are separated by commas and whose numeric range entries are separated by minus signs. There may be no embedded spaces, and all service names must belong to the specified protocol . Since service names may contain embedded minus signs, the starting entry of a range can't be a service name; it can be a port number, however. Here are some sample addresses:
-i6 - IPv6 only TCP:25 - TCP and port 25 @1.2.3.4 - Internet IPv4 host address 1.2.3.4 @[3ffe:1ebc::1]:1234 - Internet IPv6 host address 3ffe:1ebc::1, port 1234 UDP:who - UDP who service port TCP@lsof.itap:513 - TCP, port 513 and host name lsof.itap tcp@foo:1-10,smtp,99 - TCP, ports 1 through 10, service name smtp, port 99, host name foo tcp@bar:1-smtp - TCP, ports 1 through smtp, host bar :time - either TCP or UDP time service port
/ 0x801Lsof can use the mount supplement file to get device numbers for file systems when it can't get them via stat(2) or lstat(2) . The option form +m m identifies m as a mount supplement file. Note: the +m and +m m options are not available for all supported dialects. Check the output of lsof's -h or -? options to see if the +m and +m m options are available.
-o -o 10 or -oo10The default number of digits allowed after ``0t'' is normally 8, but may have been changed by the lsof builder. Consult the description of the -o o option in the output of the -h or -? option to determine the default that is in effect.
<TCP or TPI state name> QR=<read queue length> QS=<send queue length> SO=<socket options and values> SS=<socket states> TF=<TCP flags and values> WR=<window read length> WW=<window write length>Not all values are reported for all UNIX dialects. Items values (when available) are reported after the item name and '='. When the field output mode is in effect (See "OUTPUT FOR OTHER PROGRAMS" .) each item appears as a field with a `T' leading character. -T with no following key characters disables TCP/TPI information reporting. -T with following characters selects the reporting of specific TCP/TPI information:
f selects reporting of socket options, states and values, and TCP flags and values. q selects queue length reporting. s selects connection state reporting. w selects window size reporting.Not all selections are enabled for some UNIX dialects. State may be selected for all dialects and is reported by default. The -h or -? help output for the -T option will show what selections may be used with the UNIX dialect. When -T is used to select information - i.e., it is followed by one or more selection characters - the displaying of state is disabled by default, and it must be explicitly selected again in the characters following -T . (In effect, then, the default is equivalent to -Ts .) For example, if queue lengths and state are desired, use -Tqs . Socket options, socket states, some socket values, TCP flags and one TCP value may be reported (when available in the UNIX dialect) in the form of the names that commonly appear after SO_, so_, SS_, TCP_ and TF_ in the dialect's header files - most often <sys/socket.h>, <sys/socketvar.h> and <netinet/tcp_var.h>. Consult those header files for the meaning of the flags, options, states and values. ``SO='' precedes socket options and values; ``SS='', socket states; and ``TF='', TCP flags and values. If a flag or option has a value, the value will follow an '=' and the name -- e.g., ``SO=LINGER=5'', ``SO=QLIM=5'', ``TF=MSS=512''. The following seven values may be reported:
Name Reported Description (Common Symbol) KEEPALIVE keep alive time (SO_KEEPALIVE) LINGER linger time (SO_LINGER) MSS maximum segment size (TCP_MAXSEG) PQLEN partial listen queue connections QLEN established listen queue connections QLIM established listen queue limit RCVBUF receive buffer length (SO_RCVBUF) SNDBUF send buffer length (SO_SNDBUF)Details on what socket options and values, socket states, and TCP flags and values may be displayed for particular UNIX dialects may be found in the answer to the ``Why doesn't lsof report socket options, socket states, and TCP flags and values for my dialect?'' and ``Why doesn't lsof report the partial listen queue connection count for my dialect?'' questions in the lsof FAQ (The FAQ section gives its location.)
AIX 4.1.4 (AFS 3.4a) HP-UX 9.0.5 (AFS 3.4a) Linux 1.2.13 (AFS 3.3) Solaris 2.[56] (AFS 3.4a)
cwd current working directory; LnnFD is followed by one of these characters, describing the mode under which the file is open: r for read access;library references (AIX); jldjail directory (FreeBSD); ltx shared library text (code and data); Mxx hex memory-mapped type number xx. m86 DOS Merge mapped file; mem memory-mapped file; mmap memory-mapped device; pd parent directory; rtd root directory; trkernel trace file (OpenBSD); txt program text (code and data); v86 VP/ix mapped file;
AIO asynchronous I/O (e.g., FAIO) AP append ASYN asynchronous I/O (e.g., FASYNC) BAS block, test, and set in use BKIU block if in use BL use block offsets BSK block seek CA copy avoid CIO concurrent I/O CLON clone CLRD CL read CR create DF defer DFI defer IND DFLU data flush DIR direct DLY delay DOCL do clone DSYN data-only integrity EVO event only EX open for exec EXCL exclusive open FSYN synchronous writes GCDF defer during unp_gc() (AIX) GCMK mark during unp_gc() (AIX) GTTY accessed via /dev/tty HUP HUP in progress KERN kernel KIOC kernel-issued ioctl LCK has lock LG large file MBLK stream message block MK mark MNT mount MSYN multiplex synchronization NB non-blocking I/O NBDR no BDRM check NBIO SYSV non-blocking I/O NBF n-buffering in effect NC no cache ND no delay NDSY no data synchronization NET network NMFS NM file system NOTO disable background stop NSH no share NTTY no controlling TTY OLRM OLR mirror PAIO POSIX asynchronous I/O PP POSIX pipe R read RC file and record locking cache REV revoked RSH shared read RSYN read synchronization SL shared lock SNAP cooked snapshot SOCK socket SQSH Sequent shared set on open SQSV Sequent SVM set on open SQR Sequent set repair on open SQS1 Sequent full shared open SQS2 Sequent partial shared open STPI stop I/O SWR synchronous read SYN file integrity while writing TCPM avoid TCP collision TR truncate W write WKUP parallel I/O synchronization WTG parallel I/O synchronization VH vhangup pending VTXT virtual text XL exclusive lockthis list of names was derived from F* #define's in dialect header files <fcntl.h>, <linux</fs.h>, <sys/fcntl.c>, <sys/fcntlcom.h>, and <sys/file.h>; see the lsof.h header file for a list showing the correspondence between the above short-hand names and the header file definitions; the second list (after the semicolon) may contain short-hand names for kernel per-process open file flags from this table:
ALLC allocated BR the file has been read BHUP activity stopped by SIGHUP BW the file has been written CLSG closing CX close-on-exec (see fcntl(F_SETFD)) MP memory-mapped LCK lock was applied RSVW reserved wait SHMT UF_FSHMAT set (AIX) USE in use (multi-threaded)
a file access mode c process command name (all characters from proc or user structure) C file structure share count d file's device character code D file's major/minor device number (0x<hexadecimal>) f file descriptor F file structure address (0x<hexadecimal>) G file flaGs (0x<hexadecimal>; names if +fg follows) i file's inode number k link count l file's lock status L process login name m marker between repeated output n file name, comment, Internet address N node identifier (ox<hexadecimal> o file's offset (decimal) p process ID (always selected) g process group ID P protocol name r raw device number (0x<hexadecimal>) R parent process ID s file's size (decimal) S file's stream identification t file's type T TCP/TPI information, identified by prefixes (the `=' is part of the prefix): QR=<read queue size> QS=<send queue size> SO=<socket options and values> (not all dialects) SS=<socket states> (not all dialects) ST=<connection state> TF=<TCP flags and values> (not all dialects) WR=<window read size> (not all dialects) WW=<window write size> (not all dialects) (TCP/TPI information isn't reported for all supported UNIX dialects. The -h or -? help output for the -T option will show what TCP/TPI reporting can be requested.) u process user ID z Solaris 10 and higher zone name 0 use NUL field terminator character in place of NL 1-9 dialect-specific field identifiers (The output of -F? identifies the information to be found in dialect-specific fields.)
nfs ignore,noquota,dev=2a40001
BSDI BSD/OS FreeBSD HP-UX Linux NetBSD NEXTSTEP OpenBSD OPENSTEP SCO OpenServer SCO|Caldera UnixWare Solaris Tru64 UNIX
AIX
Path from the -D option; Path from an environment variable; System-wide path; Personal path (the default); Personal path, modified by an environment variable.
HP-UX 11.11 and 11.23 Linux
AIX 5.[123] Apple Darwin 7.x Power Macintosh systems BSDI BSD/OS 4.3.1 for x86-based systems FreeBSD 4.x, 4.1x, 5.x and [67].x for x86-based systems FreeBSD 5.x and [67].x for Alpha, AMD64 and Sparc64-based systems HP-UX 11.00 NetBSD 1.[456], 2.x and 3.x for Alpha, x86, and SPARC-based systems NEXTSTEP 3.[13] for NEXTSTEP architectures OpenBSD 2.[89] and 3.[01234567] for x86-based systems OPENSTEP 4.x SCO OpenServer Release 5.0.6 for x86-based systems SCO|Caldera UnixWare 7.1.4 for x86-based systems Solaris 2.6, 8, 9 and 10 Tru64 UNIX 5.1
Linux
/Homes/abe/LSOF/.lsof_vic
Inaccessible /dev warnings are enabled.
Inaccessible /dev warnings are disabled.