Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

lsfd is a Linux command for inspecting open file descriptors, including files and sockets. The util-linux manual describes it as “intended to be a modern replacement for lsof(8) on Linux systems,” but says its command-line interface and output formats differ. Use it to inspect Linux processes and kernel-specific details; translate existing lsof commands rather than swapping the command name.

What is lsfd?

lsfd is a command in the util-linux collection that reports open file descriptors on Linux. Its view can include ordinary files, sockets, and other descriptor-associated objects. It is designed around Linux kernel information and supports Linux-specific features such as namespaces, so it is not a general Unix command.

The command was introduced in util-linux 2.38. Its formatting and filtering use Libsmartcols. The project’s wording is deliberate: lsfd is a modern lsof alternative for Linux, not a drop-in replacement. util-linux lsfd manual; util-linux 2.38 release notes.

How do you find which process has a file open?

Start with an expression that matches the reported name, or limit the scan to a process whose PID you already know:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
lsfd -Q 'NAME == "/path/to/file"'
lsfd -p 1234

Replace the path and PID with the values you need. To inspect more than one known process, provide comma-separated PIDs:

lsfd -p 1234,5678

The manual notes that -p is more efficient than collecting broadly and applying an equivalent PID expression with -Q. Expression filtering is useful when the criterion is something other than a known PID:

lsfd -Q 'PID == 1234'
lsfd -Q 'ASSOC == "exe"'

The executable-association example is also shown in the util-linux 2.38 release notes. Consult the lsfd manual for expression syntax and available fields.

How do you list open descriptors and sockets?

List open descriptors

Run lsfd without filters to display open descriptors. The default table is useful for interactive inspection; for targeted output, select fields explicitly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

View IP sockets

Use the address-family options to focus the view on IPv4 or IPv6 sockets:

lsfd -i4
lsfd -i6

Inspect threads

Add -l to list at thread level when you need detail beyond the process-level view:

lsfd -l

These options and their behavior are documented in the lsfd manual.

How do you choose columns or produce JSON?

For a narrower table, pass a comma-separated column list to -o. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
UNIX and Linux System Administration Handbook, 4th Edition
  • New
  • Mint Condition
  • Dispatch same day for order received before 12 noon
  • Guaranteed packaging
  • No quibbles returns
lsfd -o COMMAND,PID,TYPE,NAME

To discover column names accepted by your installed version, run lsfd -H or lsfd --list-columns. Column availability and behavior should be checked against that version’s manual.

For machine-readable output, use JSON:

lsfd -J

Raw output can be requested with -r where appropriate. The manual also documents custom counters with --counter and summaries with --summary; combining a summary with JSON is supported only in the documented valid mode, so check the manual rather than assuming every option combination works.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Can you safely parse lsfd output in scripts?

Do not build a script around lsfd’s unqualified default table: the manual warns that default output may change. Pin the output you expect by selecting columns with -o, or use -J when a machine-readable format suits the task. Test the parser against the util-linux version deployed on the target system.

When the target PID is known, prefer -p PID over a broad scan followed by a PID condition in -Q; the manual specifically identifies the PID option as more efficient. For other predicates, use -Q and verify the expression and output fields in the installed manual.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How does lsfd differ from lsof?

Area lsfd lsof
Platform scope Linux-specific; designed around Linux kernel data. Used across a broader range of Unix-like systems.
Linux kernel details Supports Linux-specific features such as namespaces. Its platform coverage and interface are distinct from lsfd’s Linux-focused design.
Options and filters Uses its own options, including -p, -Q, and socket-family selectors. Has a different command-line interface; expressions are not mechanically interchangeable.
Output Offers column selection and JSON, while default output may change. Has its own output conventions and parsers.
Portability Appropriate for Linux systems with util-linux lsfd available. Often better suited to workflows that must span Unix-like platforms.

The comparison reflects the util-linux manual’s explicit warning that lsfd is not a drop-in lsof replacement. During migration, translate each command’s intent: check every option and filter, map the desired fields, and update any output parser. See the lsfd manual for lsfd’s interface.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.