lsof [names...]

List open files

Arguments

NameDescription
namesSelect named files or files on named file systems

Options

NameDescription
-?, -h, --helpHelp
-aApply AND to the selections (defaults to OR)
-bAvoid kernel blocks
-c <string or regexp (optional ending with /i /b /x)>Select the listing of files for processes executing a command
+c <number>COMMAND width (9)
+d <file>Search for all open instances/files/directories of directory
-d <File descriptor number>Specify a list of file descriptors (FDs) to exclude from or include in the output listing
+D <file>Search tree for all open instances/files/directories of directory. *SLOW?*
+f [flags]Enable path name arguments to be interpreted
-f <flags>Inhibit path name arguments to be interpreted
-F <options...>Select fields to output
-F?Show fields for -F
-g <PGID>Exclude or select by process group IDs (PGID)
-i <options>Selects files by [46][protocol][@hostname|hostaddr][:service|port]
-lInhibit conversion of user IDs to login names
+L [number]Enable listing of file link counts
-L [number]Disable listing of file link counts
+MEnable portMap registration
-MDisable portMap registration
-nNo host names
-NSelect NFS files
-oList file offset
-ONo overhead *RISKY*
-p <PIDs>Exclude or select process identification numbers (PIDs)
-PNo port names
+r <time (seconds)>Repeat every t seconds (15) until no files
-r <time (seconds)>Repeat every t seconds (15) forever
-RList parent PID
-s [protocol:state]List file size or exclude/select protocol
-S [timeout (seconds)]Stat timeout in seconds (lstat/readlink/stat)
-T <info>Disable TCP/TPI info
-tSpecify terse listing
-u <UIDs>Exclude/select login|UID set
-USelect Unix socket
-vList version info
-VVerbose search
+wEnable warnings
-wDisable warnings
-x <cross-over option>Cross over +d|+D File systems or symbolic links
-XFile descriptor table only