AI Generated Cheatsheets

Lsof Command Cheatsheet

The lsof command is used to display information about files and processes that are currently open or in use on a Unix-based operating system.

Basic Syntax

lsof [options]

Examples

Options

Option Description
-p Displays information about a specific PID.
-u Displays information about a specific user.
-i Displays information about open network connections.
+D Displays information about open files for a specific directory.
-c Displays information about open files for a specific command.
-t Displays only the PIDs of the matching processes.
-h Displays help information.

Resources