x-lsof
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.
Works with
Agent Skills format with YAML frontmatter. Claude Code reads it as-is.
--- name: "x-lsof" description: "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." license: "Apache-2.0" --- # x lsof - List Open Files > Enhanced `lsof` with interactive UI, fzf search, and TSV/CSV/JSON output formats. --- ## Quick Start ```bash # Interactive view (default in TTY) x lsof # fzf interactive search x lsof fz # TSV format output x lsof --tsv ``` --- ## Features - **Auto-download**: If `lsof` is 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 ```bash # 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 ```bash # Find PID listening on port 8080 x lsof --pidofport 8080 # Find all processes using port 443 x lsof -i:443 ``` ### Data Processing ```bash # 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
More General & Other skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

