x-lsof
Enhanced lsof (List Open Files) with interactive UI and structured output. View open files, network connections, and processes. **Dependency**: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-19
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- x-lsof
- license
- Apache-2.0
- metadata
- { "tags": [ "x-cmd", "system", "lsof", "files", "process", "network" ], "author": "Li Junhao", "version": "1.0.0", "category": "x-cmd-extension" }
- description
- Enhanced lsof (List Open Files) with interactive UI and structured output. View open files, network connections, and processes. **Dependency**: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.
- compatibility
- POSIX Shell
03 SKILL.md 正文
x lsof - List Open Files
Enhanced
lsofwith interactive UI, fzf search, and TSV/CSV/JSON output formats.
Quick Start
# Interactive view (default in TTY)
x lsof
# fzf interactive search
x lsof fz
# TSV format output
x lsof --tsv
Features
- Auto-download: If
lsofis not available, x-cmd automatically downloads a portable version from trusted sources - Interactive UI: TUI application for viewing open files
- fzf Integration: Interactive search with fzf
- Multiple Formats: TSV, CSV, and raw output for data processing
- Port-to-PID: Find process ID by port number
Commands
| Command | Description |
|---|---|
x lsof |
Interactive TUI view (default in TTY) / TSV (piped) |
x lsof fz |
Interactive fzf search |
x lsof --app |
TUI application view |
x lsof --tsv |
TSV format output |
x lsof --csv |
CSV format output |
x lsof --raw |
Raw format output |
x lsof --pidofport <port> |
Find PID by port number |
Examples
Basic Usage
# Interactive view (TTY default)
x lsof
# fzf interactive mode
x lsof fz
# TSV format for processing
x lsof --tsv
# CSV format
x lsof --csv
Find Process by Port
# Find PID listening on port 8080
x lsof --pidofport 8080
# Find all processes using port 443
x lsof -i:443
Data Processing
# Filter with awk
x lsof --tsv | awk -F'\t' '$2 == "TCP"'
# Import to spreadsheet
x lsof --csv > open_files.csv
# Count files by process
x lsof --tsv | cut -f1 | sort | uniq -c | sort -rn
Output Fields
| Field | Description |
|---|---|
| COMMAND | Process name |
| PID | Process ID |
| USER | User name |
| FD | File descriptor |
| TYPE | File type (REG, DIR, IPv4, IPv6) |
| DEVICE | Device number |
| SIZE/OFF | File size or offset |
| NODE | Inode number |
| NAME | File name / network connection |
Automatic Binary Download
If lsof is not installed on your system, x-cmd automatically downloads a portable version from trusted sources (pixi/conda-forge) and manages it locally. No manual installation required.
Supported platforms:
- Linux (x86_64, aarch64)
- macOS (x86_64, arm64)
- Windows (limited support)
Platform Notes
- Linux/macOS: Full support with native or auto-downloaded lsof
- Windows: Limited support, may require WSL
Related
- Native
lsof(8)manual page
04 同仓库更多 Skills
vercel-react-view-transitions
Guide for implementing smooth, native-feeling animations using React's View Transition API (`<ViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter/exit of components, animate list reorder, implement directional (forward/back) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
terraform-patterns
Implement — Terraform infrastructure-as-code agent skill and plugin for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw. Covers module design patterns, state management strategies, provider c
self-eval
Implement — Honestly evaluate AI work quality using a two-axis scoring system. Use after completing a task, code review, or work session to get an unbiased assessment. Detects score inflation,
helm-chart-builder
Implement — Helm chart development agent skill and plugin for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw — chart scaffolding, values design, template patterns, dependency management, sec
docker-development
Implement — Docker and container development agent skill and plugin for Dockerfile optimization, docker-compose orchestration, multi-stage builds, and container security hardening. Use when: u