OPTIONS
In the absence of any options, lsof lists all open files belonging to all active processes.
If any list request option is specified, other list requests must be specifically requested - e.g., if -U
is specified for the listing of UNIX socket files, NFS files wonât be listed unless -N is also specified;
or if a user list is specified with the -u option, UNIX domain socket files, belonging to users not in
the list, wonât be listed unless the -U option is also specified.
Normally list options that are specifically stated are ORed - i.e., specifying the -i option without an
address and the -ufoo option produces a listing of all network files OR files belonging to processes
owned by user ââfooââ. The exceptions are:
1) the â^â (negated) login name or user ID (UID), specified with the -u option;
2) the â^â (negated) process ID (PID), specified with the -p option;
3) the â^â (negated) process group ID (PGID), specified with the -g option;
4) the â^â (negated) command, specified with the -c option;
5) the (â^â) negated TCP or UDP protocol state names, specified with the -s [p:s] option.
Since they represent exclusions, they are applied without ORing or ANDing and take effect before any
other selection criteria are applied.
The -a option may be used to AND the selections. For example, specifying -a, -U, and -ufoo produces a
:
Partager