lsof
stands for list open files, a CLI tool to display infos about the files currently open by processes on a Unix or Unix-like OS.
lsof
can be used to identify which processes are using specific files, which files are being used by specific processes, which network connections are open.
-c NAME
: filter by process name or command name.
-u NAME
: filter by user name or user ID.
-i :port
: display only network connections.
-p PID
: filter by process ID.
-t
: display only the process IDs that match the specified criteria.
Note: this requires root privileges.