lsfd
List open files
TLDR
List all open file descriptors
List all files kept open by a specific program
Check what program has a specific file open
List open IPv4 or IPv6 sockets
Display help
SYNOPSIS
lsfd [-p pid] [-u user]
PARAMETERS
-p pid
List open files for a specific process ID (PID).
-u user
List open files for a specific user.
-h
Show help message and exit
DESCRIPTION
lsfd is a command-line utility designed to quickly list all open files on a Linux system.
It offers a faster alternative to the more comprehensive lsof command, achieving this speed by focusing specifically on file descriptor information. It retrieves data directly from the /proc filesystem, reading the file descriptors for each process. This direct approach bypasses some of the overhead associated with lsof.
While lsfd is fast, it is important to note that its scope is narrower. It primarily shows file paths opened by process and doesn't provide detailed information about network connections, sockets or other non-file descriptor activities that lsof can handle. Therefore, it is most suited for situations where you need a quick overview of open file paths and the processes using them.
CAVEATS
lsfd only shows file descriptors and not network connections or other types of file-like objects handled by lsof.
INSTALLATION
lsfd may not be installed by default on all systems. It is often available in distribution package repositories (e.g., apt, yum). Installation usually involves using the distribution's package manager. For example, `apt-get install lsfd`.
OUTPUT INTERPRETATION
The output of lsfd typically shows the PID, the command name associated with the process, and the full path of the open file. The path is the most useful bit of information to understand where the process reads and writes data. Understanding the output requires a basic understanding of how Linux processes interact with files.
HISTORY
lsfd was developed to provide a faster alternative to lsof when only information about open files is required. Its focus on speed is achieved by directly accessing the /proc filesystem. As such, lsfd trades some functionality in favor of quick execution.