thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Systems & Data Center · Intermediate

lsof

A Linux command that lists open files and the processes using them, including network sockets.

Definition

Because sockets and devices are files in Linux, lsof can show which process holds a file, port or mount point. lsof +L1 shows deleted files still held open.

Example

lsof -i :3306 shows the process listening on the MySQL port.

Exam tip

Use lsof +L1 when df shows full but du does not: deleted files are still open.

Related terms