+|-f [cfgGn]
f by itself clarifies how path name arguments are to be interpreted. When followed by c, f, g, G, or n in any combination it specifies that the listing of kernel file structure information is to be enabled (`+') or inhibited (`-').
Normally a path name argument is taken to be a file system name if it matches a mounted-on directory name reported by mount(8), or if it represents a block device, named in the mount output and associated with a mounted directory name.
When +f is specified, all path name arguments will be taken to be file system names, and lsof will complain if any are not. This can be useful, for example, when the file system name (mounted-on device) isn't a block device. This happens for some CD-ROM file systems.
When -f is specified, all path name arguments will be taken to be simple files. Thus, for example, the ``-f /'' arguments direct lsof to search for open files with a `/' path name, not all open files in the `/' (root) file system.
Be careful to make sure +f is properly terminated and isn't followed by a character (e.g., of the file or file system name) that might be taken as a parameter. For example, use ``--'' after +f as in this example.
$ lsof +f -- /file/system/name
The 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:
- c file structure use count
- f file structure address
- g file flag abbreviations
- G file flags in hexadecimal
- n file structure node address
When 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.