Fetching directory, one moment please ...
Lists information on files opened by processes.
Used without any parameters, lsof will display all open files for all processes. Because Linux defines pipes, sockets and devices as files, you can list these as well as disk files with lsop. You restrict output to certain processes using the -c option. Examples are:
Show files open by firefox lsof -c firefox
Show files open by processes starting with thunder lsof -c /thunder./ (note: the text between the slashes (/ /) are regular expresions).
You can find out which processes have open handles on a file. For example:
List processes with open handles on /etc/passwd lsof /etc/apsswd
To find all processes that have files open in a directory use +D. For example:
List processes with files open in /etc, and the files opened lsof +D /etc
You can determine who is running a process:
Show users running firefox lsof `which firefox` (note: the parameter is enclosed between back-ticks, not single quotes).
Another handy feature of lsof is its' ability to display network connections. For example:
Display all processes with open sockets lsof -1
Display processes with open sockets on port TCP 22 lsof -iTCP:22
List all processes with sockets open to host 192.168.0.21 lsof -firstname.lastname@example.org
List all processes with sockets open to host www.ez.com.au lsof -email@example.com
This utility is highly featured and parameters can be used to include or exclude processes, users, directories, sockets, etc in the output. The output itself can be customised to specify the information contained in columns. The output can also be formatted for processing by another program
|Diagnostic Target:||OS - Threads and Processes|
|Obtain From:||Download from purdue.edu|