lsof

Overview

Lists information on files opened by processes.

Usage Guide

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 -i@192.168.0.21
List all processes with sockets open to host www.ez.com.au lsof -i@www.ez.com.au

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

Tool Data

Operating Platform:Linux
Diagnostic Target:OS - Threads and Processes
Tool Executable:lsof
Obtain From:Download from purdue.edu

Results for Tools search

You entered the search string "".
No results were returned for this string.

Copyright © 1997 - 2016 Mission Pacific Pty Ltd. All rights reserved. ezcom, the ez logo and hard tech cafe are registered trademarks of Mission Pacific Pty Ltd. Designed for firefox and safari. Sitemap