Introduction to lsof

The lsof package is useful to LiSt Open Files for a given running application or process.

This package is known to build and work properly using an LFS 12.1 platform.

Package Information

lsof Dependencies




Nmap-7.94 (with a symbolic link nc pointing to ncat in /usr/bin; used in tests)

Kernel Configuration

To run the tests, the following option should be enabled in the kernel configuration:

General setup --->
  [*] POSIX Message Queues                                        [POSIX_MQUEUE]

Installation of lsof

Install lsof by running the following commands:

./configure --prefix=/usr --disable-static &&

The tests should be run as the root user. They require that the POSIX message queues are enabled in the kernel, and that Nmap-7.94 be installed with a symbolic link /usr/bin/nc pointing to ncat.

make check

Now, as the root user:

make install

Command Explanations

--disable-static: This switch prevents installation of static versions of the libraries.


Installed Program: lsof
Installed Libraries:
Installed Directories: None

Short Descriptions


lists open files for running processes

contains an interface for applications to list open files