id = "lsof" name = "lsof" description = "List open files." executables = ["lsof"] [commands] format = 1 label = "List open files" description = "Select open files by process, user, command or network address. Field output, repeat mode and NFS options are left out." quality = "ai-draft" base = "fig:lsof" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/lsof.ts" license = "MIT" [[commands.field]] id = "network" label = "Network files (-i)" description = "Address as [46][protocol][@host][:port], for example :8080 or TCP@localhost. Leave unset for all network files." type = "string" option = ["-i"] sources = ["fig"] [[commands.field]] id = "pids" label = "Process IDs" description = "Comma-separated PIDs; prefix with ^ to exclude." type = "string" option = ["-p"] sources = ["fig"] [[commands.field]] id = "users" label = "Users" description = "Comma-separated login names or UIDs." type = "string" option = ["-u"] sources = ["fig"] [[commands.field]] id = "command" label = "Command name prefix" type = "string" option = ["-c"] sources = ["fig"] [[commands.field]] id = "and" label = "AND the selections (default is OR)" type = "boolean" option = ["-a"] sources = ["fig"] [[commands.field]] id = "no_hosts" label = "No host name lookup" type = "boolean" option = ["-n"] sources = ["fig"] [[commands.field]] id = "no_ports" label = "No port name lookup" type = "boolean" option = ["-P"] sources = ["fig"] [[commands.field]] id = "terse" label = "Terse output (PIDs only)" type = "boolean" option = ["-t"] sources = ["fig"] [[commands.field]] id = "unix_sockets" label = "Unix sockets only" type = "boolean" option = ["-U"] sources = ["fig"] [[commands.field]] id = "names" label = "Files or directories" type = "path" position = 0 multiple = true path = { kind = "any", role = "input" } sources = ["fig"] [[commands.task]] id = "port" label = "Who is using a port" fields = ["network", "no_hosts", "no_ports"] required = ["network"] set = { no_hosts = [true], no_ports = [true] } [[commands.task]] id = "process" label = "Files opened by a process" fields = ["pids", "no_hosts", "no_ports"] required = ["pids"] [[commands.group]] id = "basic" label = "Basic" fields = ["network", "pids", "no_hosts", "no_ports"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["and", "unix_sockets", "terse", "command", "users", "names"]