lsofrs 4.9.1

Modern, high-performance lsof implementation in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
.\" lsofrsall(1) — comprehensive all-in-one man page for lsofrs
.\" Modeled after zshall(1): every man page in one document.
.\" Render with:  man -l man/man1/lsofrsall.1
.\" Install:      cp man/man1/lsofrsall.1 /usr/local/share/man/man1/
.TH LSOFRSALL 1 "2026-07-02" "lsofrs 4.9.1" "User Commands"
.SH NAME
lsofrsall \- the lsofrs comprehensive reference (invocation, selection,
network, display, advanced modes, TUI, themes, architecture, performance)
.SH OVERVIEW
This is the all-in-one
.B lsofrs
manual, modeled on
.BR zshall (1).
It concatenates the major sections of the lsofrs reference into a single
page so you can grep with `/`:
.RS 2
.PP
.B 1.  INVOCATION
.RB "\(em " "basic usage, repeat mode, FILE arguments"
.br
.B 2.  SELECTION CRITERIA
.RB "\(em " "every -c/-d/-p/-u/-g flag, AND/OR mode"
.br
.B 3.  NETWORK SELECTION
.RB "\(em " "-i address syntax, -n/-P/-N/-U"
.br
.B 4.  DISPLAY FORMATS
.RB "\(em " "-F fields, -J JSON, -t terse, -0 NUL, --csv, +L link counts, -l/-o/-s/+c/-T"
.br
.B 5.  ADVANCED LIVE MODES
.RB "\(em " "--tui, --top, --watch, --stale, --ports, --pipe-chain, --net-map, --tree, --monitor, --follow, --leak-detect, --summary, --delta"
.br
.B 6.  CYBERPUNK THEMES
.RB "\(em " "31 built-in themes, custom palette editor"
.br
.B 7.  INTERACTIVE CONTROLS
.RB "\(em " "every TUI keybinding"
.br
.B 8.  ARCHITECTURE
.RB "\(em " "FFI to Darwin / Linux / FreeBSD, rayon parallel gather"
.br
.B 9.  PERFORMANCE
.RB "\(em " "5\(en21x faster than lsof / lsofng"
.br
.B 10. ENVIRONMENT
.RB "\(em " "vars that influence lsofrs"
.br
.B 11. FILES
.RB "\(em " "config, completions, man pages"
.br
.B 12. EXIT STATUS
.br
.B 13. EXAMPLES
.RE
.PP
For a shorter quick-reference page see
.BR lsofrs (1).
.SH NAME
lsofrs, lsf \- list open files (modern Rust implementation of lsof)
.SH SYNOPSIS
.B lsofrs
.RI [ OPTION ]...\&
.RI [ FILE ]...\&
.br
.B lsf
.RI [ OPTION ]...\&
.RI [ FILE ]...\&
.PP
.B lsf
is the shorter form of
.BR lsofrs
\(em same binary, quicker to type.
.SH DESCRIPTION
.B lsofrs
maps the invisible topology between processes and the files they hold
open: regular files, directories, sockets, pipes, devices, kqueues \(em
anything the kernel touches.  If a process has a file descriptor,
.B lsofrs
sees it.
.PP
A Rust rewrite of
.BR lsofng (1)
with
.B zero-copy
.IR repr(C)
FFI to Darwin / Linux / FreeBSD kernel headers,
.B rayon
work-stealing per-PID FD enumeration, and a streaming
.IR "gather \(-> filter \(-> print"
pass.  When output goes to a TTY a cyberpunk theme is applied
(headers rewritten, ANSI color enabled); when piped or redirected,
plain output is used (safe for scripts).
.SH "1.  INVOCATION"
With no arguments,
.B lsofrs
lists every open file for every process visible to the calling user.
When one or more
.I FILE
arguments are given, only processes holding those files are shown.
.PP
The
.BI \-r " SECONDS"
flag puts
.B lsofrs
into repeat mode: re-scan every
.I SECONDS
seconds (default 1).  Combine with
.B \-\-delta
for change highlighting.
.PP
Combine selection flags with the boolean modifier
.BR \-a
to switch from the default OR behavior to AND.  For example,
.B "lsf \-a \-u root \-i TCP"
lists only TCP files owned by root, while
.B "lsf \-u root \-i TCP"
(no
.BR \-a )
lists every file owned by root plus every TCP file system-wide.
.SH "2.  SELECTION CRITERIA"
.TP
.B \-a
AND selection mode.  All specified filters must match a process for it
to appear.  Default is OR mode.
.TP
.BI \-c " COMMAND"
Select processes whose command name matches
.IR COMMAND .
Supports prefix matching, exclusion with
.BR ^ ,
and regular expressions enclosed in
.BR / .
Comma-separated for multiple values.
.RS
.PP
Examples:
.PP
.B "lsf \-c Chrome"
\(em prefix match.
.br
.B "lsf \-c ^Chrome"
\(em exclude Chrome.
.br
.B "lsf \-c /^firefox/"
\(em regex.
.br
.B "lsf \-c bash,zsh,fish"
\(em multiple.
.RE
.TP
.BI \-d " FD"
Select by file descriptor.  Accepts comma-separated values, ranges
.RI ( N \- M ),
and exclusions with
.BR ^ .
Special tokens like
.BR cwd ,
.BR rtd ,
.BR txt ,
.BR mem
are matched textually.
.TP
.BI \-g " PGID"
Select by process group ID.  Comma-separated;
.B ^
to exclude.
.TP
.BI \-p " PID"
Select by process ID.  Comma-separated;
.B ^
to exclude.
.TP
.BI \-u " USER"
Select by login name or UID.  Comma-separated;
.B ^
to exclude.
.SH "3.  NETWORK SELECTION"
.TP
.BI \-i " [ADDR]"
Select internet connections.  Optional address specification:
.BR [4|6][proto][@host|addr][:svc|port] .
Without an argument, selects all internet files.
.RS
.PP
Examples:
.PP
.B "lsf \-i TCP"
\(em all TCP.
.br
.B "lsf \-i 6"
\(em all IPv6.
.br
.B "lsf \-i :80"
\(em port 80 (any protocol).
.br
.B "lsf \-i TCP:22"
\(em SSH only.
.br
.B "lsf \-i @192.168.1.1"
\(em connections to/from one host.
.br
.B "lsf \-i 4UDP@dns:53"
\(em IPv4 UDP to DNS port 53.
.RE
.TP
.B \-n
Inhibit conversion of host numbers to host names.  Faster (no DNS
lookups) and avoids hangs on broken resolvers.
.TP
.B \-N
Select NFS files only.
.TP
.B \-P
Inhibit conversion of port numbers to port names.  Faster and avoids
.IR /etc/services
parsing.
.TP
.B \-U
Select UNIX domain socket files only.
.SH "4.  DISPLAY FORMATS"
.TP
.BI \-F " [FIELDS]"
Produce machine-readable field output.  Each output line is prefixed
with a single character identifying the field.  Field characters:
.RS
.PP
.B p
\(em PID
.br
.B c
\(em command name
.br
.B f
\(em file descriptor
.br
.B n
\(em file name / path
.br
.B t
\(em file type (REG, DIR, IPv4, IPv6, PIPE, ...)
.br
.B u
\(em UID
.br
.B L
\(em login name
.br
.B s
\(em file size
.br
.B i
\(em inode
.br
.B d
\(em device number
.br
.B g
\(em PGID
.br
.B R
\(em parent PID
.RE
.TP
.BR \-J ", " \-\-json
Emit each row as a JSON object, one per line (JSONL/NDJSON).
Compatible with
.BR jq (1).
.TP
.BI +L " [n]"
List file link counts in an
.B NLINK
column.
.B +L
alone lists every link count;
.BI +L n
restricts output to files whose link count is less than
.IR n .
.B +L1
selects open files that have been unlinked (link count 0) \(em the
lsof-native equivalent of
.BR \-\-stale .
Link counts are unavailable for sockets and most pipes/FIFOs, so those
are never selected by
.BI +L n .
.TP
.B \-\-csv
Pure CSV output (RFC 4180 quoting) for spreadsheets and pipelines.
Header row included unless suppressed.
.TP
.B \-R
Show parent PID column (PPID).
.TP
.B \-\-pgid\-show
Show process group ID column (PGID).
.TP
.B \-t
Terse output: print PIDs only, one per line.  Useful with
.BR xargs (1)
for killing matched processes.
.TP
.B \-0
Use NUL byte as the field terminator instead of newline in
.B \-F
output.  Safe for filenames containing newlines.
.TP
.B \-w
Suppress warning messages on stderr.
.TP
.B \-l
Show the numeric user ID instead of resolving it to a login name.
.TP
.BI \-o " [n]"
Always display the file offset instead of size in the SIZE/OFF column;
optional
.I n
sets the number of decimal digits.
.TP
.B \-s
Bare: always display file size.  With
.IR proto : state
(e.g.
.BR TCP:LISTEN ", " UDP:Idle ):
select only sockets in those states (comma-separate multiple states).
.TP
.BI +c " [w]"
Command column width in initial characters;
.B +c0
means unlimited.  Default 15.
.TP
.B \-T
Request TCP/TPI info.  lsofrs shows the connection state by default, so this
is accepted for compatibility.
.TP
.B \-V
Report each search specification (\fB\-p\fR, \fB\-c\fR, \fB\-u\fR, and named
files) that matched nothing, one per line on standard error.
.TP
.BR \-v ", " \-\-version
Display version information and exit.
.TP
.BR \-h ", " \-\-help
Display help and exit.
.SS Compatibility options (accepted, no effect on this platform)
.PP
For drop-in compatibility with scripts written against
.BR lsof (8),
the following options are parsed and silently ignored (their arguments, where
present, are consumed):
.BR \-A ", " \-b ", " \-C ", " \-D ", " +|\-E ", " +|\-e ", " +|\-f ", "
.BR \-K ", " \-k ", " +|\-m ", " +|\-M ", " \-O ", " \-S ", " \-x ", "
.BR +|\-X ", " \-z ", " \-Z .
.SH "5.  ADVANCED LIVE MODES"
.SS 5.1 Unified TUI (\-\-tui)
Full-screen tabbed dashboard with all modes in one interface.  7
clickable tabs, 31 color themes, mouse support, hover and right-click
tooltips, theme chooser and editor, config persistence.
.PP
.B Tabs:
TOP | SUMMARY | PORTS | TREE | NET-MAP | PIPES | STALE.  Click tab or
press Tab / 1\-7 to switch.
.PP
.B Bottom bar:
.RS 2
.PP
.B ">>> LSOFRS <<< \(or procs:N \(or files:N \(or tcp:N udp:N unix:N pipe:N \(or rate:Ns \(or theme:NAME \(or paused:no \(or h=help \(or HH:MM:SS"
.RE
.PP
Each
.B \(or
segment is a hover zone with verbose tooltip.
.PP
.B Examples:
.PP
.B "lsf \-\-tui"
\(em launch TUI, restore last tab and theme.
.br
.B "lsf \-\-tui \-\-theme matrix"
\(em launch with Matrix theme.
.br
.B "sudo lsf \-\-tui"
\(em full visibility (all processes).
.SS 5.2 Top-N Dashboard (\-\-top)
Live auto-refreshing dashboard of the top processes sorted by FD count.
Like
.BR iotop (1)
for file descriptors \(em shows FD type distribution bars, delta
tracking, per-process breakdowns.
.PP
.BI \-\-top " [N]"
defaults to 20.  Top-specific keys:
.B s
cycle sort,
.B r
reverse,
.BR + / \-
show more/fewer,
.B b
toggle distribution bar,
.B d
toggle delta column.
.SS 5.3 File Watch (\-\-watch FILE)
Monitor who opens and closes a specific file over time.  Prints
timestamped
.B +OPEN
/
.B \-CLOSE
events as they happen \(em a lightweight
.BR inotifywait (1)
/
.BR fs_usage (1)
for a single path.  Each event shows timestamp, open/close tag, PID,
user, FD, command.  When piped, prints a single snapshot and exits.
.SS 5.4 Stale FDs (\-\-stale)
Find file descriptors pointing to deleted files \(em a common source of
disk-space leaks, zombie file handles, and security issues.  Combine
with
.B \-u USER
to scope to one user.  Supports
.B \-\-json
output.
.SS 5.5 Listening Ports (\-\-ports)
Quick "what's listening where" summary, like
.B "ss \-tlnp"
but cross-platform (macOS + Linux).  Use
.B \-\-json
for JSON output;
.B "\-u root"
to scope to a user.
.SS 5.6 Pipe Chain (\-\-pipe-chain)
Trace pipe and UNIX socket pairs between processes \(em visualize the
IPC topology.  Combine with
.B \-c
to scope to one command tree.
.SS 5.7 Network Map (\-\-net-map)
Group network connections by remote host \(em see which servers your
system talks to and how many connections each has.
.SS 5.8 CSV Export (\-\-csv)
Pure CSV output for pipelines, spreadsheets, and data analysis.
RFC 4180-compliant quoting.  Combine with selection flags and redirect
to file:
.B "lsf \-\-csv \-p 1234 > out.csv"
.SS 5.9 Process Tree (\-\-tree)
Hierarchical process tree view with FD counts, type breakdowns, and
network connection counts.  Like
.BR pstree (1)
meets
.BR lsof (8).
Each node shows: PID, user, FD count, command, type breakdown
.RI ( [REG:12 IPv4:3 PIPE:2] ),
network connection count.  Notable files (sockets, pipes) listed inline
under each process.
.SS 5.10 Live Monitor (\-\-monitor / \-W)
Full-screen alternate-buffer display like
.BR top (1).
Auto-refreshes; interactive controls.  Keys:
.B s
sort,
.B r
reverse,
.B f
filter,
.B p
pause,
.B ?
help,
.B q
quit.
.SS 5.11 Follow Mode (\-\-follow PID)
Watch a single process's FDs in real-time.  New opens highlighted
.B +NEW
in green, closes
.B \-DEL
in red.
.SS 5.12 FD Leak Detection (\-\-leak-detect)
Monitors per-process FD counts over time.  Flags processes with
monotonically increasing FD counts.
.PP
.BR \-\-leak-detect [= INTERVAL [, THRESHOLD ]]
defaults to 5-second interval, 3-iteration threshold (minimum 2).
.SS 5.13 Summary / Statistics (\-\-summary)
Aggregate FD breakdown with bar charts, top processes, per-user totals.
Add
.B \-r N
for live auto-refreshing TUI mode.
Add
.B \-i
for network-only summary.
.SS 5.14 Delta Highlighting (\-\-delta)
Color-code changes between repeat iterations.  New FDs in green, gone
in red.  Combine with
.B "\-r SECONDS"
for live monitoring.
.SH "6.  CYBERPUNK THEMES"
When output goes to a TTY,
.B lsofrs
activates cyberpunk-themed column headers and ANSI coloring:
.PP
.TS
tab(|);
l l.
T{
.B Piped
T}|T{
.B TTY
T}
COMMAND|PROCESS
PID|PRC
USER|H4XOR
TYPE|CL4SS
DEVICE|DEV/ICE
SIZE/OFF|BYT3/0FF
NODE|N0DE
NAME|T4RGET
.TE
.PP
When piped or redirected, plain headers and no colors are used \(em
safe for scripts.
.PP
.B 31 built-in themes
are selectable via
.B \-\-theme NAME
or interactively via
.B c
in TUI modes.  Theme editor
.RB ( C )
creates custom 6-color palettes, adjustable 0\-255 per channel, named
and saved to
.IR ~/.lsofrs.conf .
.SH "7.  INTERACTIVE CONTROLS"
All live TUI modes
.RB ( \-\-tui ,
.BR \-\-top ,
.BR "\-\-summary \-r" )
share common keybindings.
.SS Common keys
.TS
tab(|);
l l.
.B Key|.B Action
1\-9|Set refresh interval (seconds)
< / >|Fine-adjust refresh interval (\(+-1s)
p|Pause/resume data collection
? / h|Toggle help overlay
c|Open theme chooser (31 themes with swatches)
C|Open theme editor (custom 6-color palettes)
T|Toggle hover tooltips (right-click still works)
x|Toggle border
t|Toggle compact/expanded view
o|Freeze/unfreeze sort order
/|Filter popup (regex search)
0|Clear filter
j/k/Up/Down|Navigate rows
F|Pin/unpin selected row
y|Copy selected row to clipboard
e|Export current tab to file
q / Esc / Ctrl-C|Quit
.TE
.SS \-\-tui additional keys
.TS
tab(|);
l l.
.B Key|.B Action
Tab / Right|Next tab
BackTab / Left|Previous tab
1\-7|Jump to tab by number
Click tab|Switch to clicked tab
Right-click row|Verbose tooltip (PID, FDs, kill hints)
Hover 1s|Auto-tooltip (disappears on mouse move)
.TE
.SS \-\-top additional keys
.TS
tab(|);
l l.
.B Key|.B Action
s|Cycle sort column (FDs/PID/USER/REG/SOCK/PIPE/OTHER/DELTA/CMD)
r|Reverse sort order
+ / \-|Show more/fewer processes (\(+-5)
b|Toggle distribution bar column
d|Toggle delta column
.TE
.PP
Non-TTY (piped) output always does a single-shot print and exits \(em no
TUI, no key handling.
.SH "8.  ARCHITECTURE"
.B lsofrs
is structured as a streaming
.IR "gather \(-> filter \(-> print"
pipeline.  Per-platform FFI modules
.RB ( darwin.rs ,
.BR linux.rs ,
.BR freebsd.rs )
expose a uniform
.B Process
/
.B OpenFile
data model;
.B filter.rs
applies selection criteria;
.B output.rs
,
.BR json.rs ,
.BR csv_out.rs
format the result.
.PP
.B Per-PID FD enumeration is rayon-parallelized,
fanning out across every CPU core.  Username lookups
.RB ( "getpwuid_r" )
are cached behind
.B OnceCell
to avoid repeated NSS hits.  Service-name lookups
.RB ( "getservbyport" )
are similarly cached.
.PP
.B FFI is zero-copy.
Kernel structures are described as
.B repr(C)
Rust structs and read directly from
.BR libproc (Darwin),
.BR /proc (Linux),
.BR sysctl (FreeBSD)
with no intermediate string copies.
.PP
.B File layout:
.PP
.RS 2
.nf
src/main.rs       \(em CLI entry, dispatch, repeat / leak loops
src/cli.rs        \(em clap argument definitions + custom help
src/types.rs      \(em core data structures
src/darwin.rs     \(em macOS libproc FFI (rayon parallel)
src/linux.rs      \(em Linux /proc filesystem (rayon parallel)
src/freebsd.rs    \(em FreeBSD sysctl + procfs
src/filter.rs     \(em selection & filtering
src/strutil.rs    \(em safe UTF-8 truncation for fixed-width display
src/output.rs     \(em columnar & field output, ANSI theming
src/json.rs       \(em JSON serialization (serde)
src/monitor.rs    \(em live full-screen (crossterm alternate screen)
src/follow.rs     \(em single-process FD tracking
src/leak.rs       \(em circular-buffer leak detector
src/delta.rs      \(em iteration-diff engine
src/summary.rs    \(em aggregate statistics with bar charts
src/tree.rs       \(em process tree with FD inheritance
src/tui_app.rs    \(em shared TUI framework (TuiMode trait, ratatui)
src/tui_tabs.rs   \(em unified tabbed TUI (--tui)
src/theme.rs      \(em 31 color themes + custom theme support
src/config.rs     \(em TOML config persistence (~/.lsofrs.conf)
src/top.rs        \(em live top-N FD dashboard
src/watch.rs      \(em file watch
src/stale.rs      \(em stale FD finder
src/ports.rs      \(em listening ports summary
src/pipe_chain.rs \(em pipe/socket IPC topology
src/csv_out.rs    \(em CSV export
src/net_map.rs    \(em network connection grouping
.fi
.RE
.SH "9.  PERFORMANCE"
Benchmarks on a ~470-process / ~5,000-FD macOS box,
.BR hyperfine (1),
10 runs, 3 warmup:
.PP
.TS
tab(|);
l l l l.
.B Workload|.B lsofrs|.B lsof 4.91|.B lsofng
All open files (default)|14.2 ms|169.8 ms|175.5 ms
Network connections (-i TCP)|11.5 ms|110.5 ms|140.1 ms
Terse output (-t, PIDs only)|6.9 ms|101.4 ms|142.9 ms
Structured (-J JSON / -F)|29.3 ms|156.1 ms|136.7 ms
.TE
.PP
.B Speedup:
5\(en21x faster than traditional lsof implementations.  Rayon-parallel
per-PID FD enumeration + zero-copy FFI structs + OnceCell-cached
username lookups account for the bulk of the win.
.SH "10. ENVIRONMENT"
.TP
.B LSOFRS_CONF
Override the config file path (default
.IR ~/.lsofrs.conf ).
.TP
.B NO_COLOR
When set,
.B lsofrs
emits plain headers and no ANSI color even on a TTY.  See
.UR https://no-color.org/
NO_COLOR specification
.UE .
.TP
.B TERM
Used to detect terminal capability for color and TUI modes.  Setting
to
.B dumb
disables color and TUI.
.SH "11. FILES"
.TP
.I ~/.lsofrs.conf
TOML config file: persists last-used TUI tab, theme selection, custom
6-color palettes, and per-mode preferences.
.TP
.I /usr/local/share/man/man1/lsofrs.1
Short reference man page.
.TP
.I /usr/local/share/man/man1/lsofrsall.1
This man page.
.TP
.I /usr/local/share/zsh/site-functions/_lsofrs
Zsh completion function (installed separately from the
.IR completions/
directory in the source tree).
.SH "12. EXIT STATUS"
.TP
.B 0
Successful completion.
.TP
.B 1
An error occurred, or no matching files were found.
.SH "13. EXAMPLES"
.PP
List all open files (default behavior):
.RS
.nf
lsf
.fi
.RE
.PP
Files opened by PID 1234:
.RS
.nf
lsf \-p 1234
.fi
.RE
.PP
Everything Chrome is touching:
.RS
.nf
lsf \-c Chrome
.fi
.RE
.PP
List processes using a specific file:
.RS
.nf
lsf /var/log/syslog
.fi
.RE
.PP
All TCP connections:
.RS
.nf
lsf \-i TCP
.fi
.RE
.PP
What's listening on port 8080:
.RS
.nf
lsf \-i :8080
.fi
.RE
.PP
Files owned by root:
.RS
.nf
lsf \-u root
.fi
.RE
.PP
Process tree for root's processes:
.RS
.nf
lsf \-\-tree \-u root
.fi
.RE
.PP
JSON output of all open files:
.RS
.nf
lsf \-\-json
.fi
.RE
.PP
JSON for one PID, piped through jq:
.RS
.nf
lsf \-J \-p 1234 | jq '.name'
.fi
.RE
.PP
Detect FD leaks polling every 10 seconds with threshold 5:
.RS
.nf
lsf \-\-leak\-detect=10,5
.fi
.RE
.PP
Show listening ports:
.RS
.nf
lsf \-\-ports
.fi
.RE
.PP
Find deleted files still held open:
.RS
.nf
lsf \-\-stale
.fi
.RE
.PP
Live monitor mode (full-screen):
.RS
.nf
lsf \-W
.fi
.RE
.PP
Launch the unified TUI with Matrix theme:
.RS
.nf
lsf \-\-tui \-\-theme matrix
.fi
.RE
.PP
Repeat every 2 seconds with delta highlighting:
.RS
.nf
lsf \-r 2 \-\-delta
.fi
.RE
.PP
CSV export filtered by user:
.RS
.nf
lsf \-\-csv \-u www\-data
.fi
.RE
.PP
Network connection map:
.RS
.nf
lsf \-\-net\-map
.fi
.RE
.PP
Trace pipe chains between processes:
.RS
.nf
lsf \-\-pipe\-chain
.fi
.RE
.PP
Kill every process matching a name:
.RS
.nf
lsf \-t \-c badprocess | xargs kill
.fi
.RE
.PP
AND mode: only TCP connections by root:
.RS
.nf
lsf \-a \-u root \-i TCP
.fi
.RE
.SH SEE ALSO
.BR lsofrs (1),
.BR lsof (8),
.BR fstat (1),
.BR ss (8),
.BR netstat (1),
.BR pstree (1),
.BR top (1),
.BR proc (5),
.BR strykeall (1),
.BR zshrsall (1)
.SH AUTHORS
.B Jacob Menke
.RI < https://github.com/MenkeTechnologies >
.PP
A Rust rewrite of
.BR lsofng (1)
by Jacob Menke, which itself is a modernized fork of the original
.BR lsof (8)
by Vic Abell.