lsof command

lsof command is an advanced Unix command that is typically not installed with a Unix/Linux distro but can be easily obtained from standard package repositories in most of modern OS distributions.

lsof stands for list open files, but since everything in Unix is a file, you get a lot more than just a list of files open by a given process.

What lsof Is Great For

  • Show all the network connections open on your system (with process names to see what is responsible for each connection)
  • Show list of files open on the operating system or single process level
  • Confirm what is using a specific file or directory
  • Confirm what is using a particular network port

See Also