Linux: Show Opened Files, lsof

By Xah Lee. Date: . Last updated: .

You can use the command lsof to list all files opened by processes.

In unix/linux, “everything” is a file. Devices (such as all USB device) are files, network sockets are files, directory is a file.

Here's some of the commonly used options.

linux lsof 2017 04 18
lsof showing first few files opened by firefox

FD → means “file descriptor”. Common FD code are:

see man lsof for complete list and description.

TYPE → is the file type. Common types are:

Sys Admin

  1. Job Control
  2. ps
  3. top
  4. htop
  5. RAM stat
  6. Users and Groups
  7. File Permission
  8. Opened Files: lsof
  9. shutdown, sleep

If you have a question, put $5 at patreon and message me.