Skip to content
Skillv1.0.0

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

by x-cmd(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from x-cmd/x-cmd (mod/lsof/SKILL.md). Install upstream with npx skills add x-cmd/x-cmd --skill lsof. Copyright stays with the author (Apache-2.0).

x lsof - List Open Files

Enhanced lsof with 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 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

# 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

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/x-cmd-x-cmd-lsof/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

x-cmd-x-cmd-lsof.ocm.jsonjson
{
  "ocm": "1",
  "id": "x-cmd-x-cmd-lsof",
  "kind": "skill",
  "name": "x-lsof",
  "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.",
  "publisher": "x-cmd",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "x-cmd",
      "system",
      "lsof",
      "files",
      "process",
      "network",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "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."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/x-cmd/x-cmd",
      "path": "mod/lsof/SKILL.md",
      "ref": "e18c1ef8b4695c7556c4e847b2eb7eaac13b9230",
      "url": "https://github.com/x-cmd/x-cmd/blob/e18c1ef8b4695c7556c4e847b2eb7eaac13b9230/mod/lsof/SKILL.md",
      "key": "x-cmd/x-cmd/mod/lsof/SKILL.md"
    },
    "compatibility": "POSIX Shell",
    "license": "Apache-2.0"
  },
  "instructions": "# x lsof - List Open Files\n\n> Enhanced `lsof` with interactive UI, fzf search, and TSV/CSV/JSON output formats.\n\n---\n\n## Quick Start\n\n```bash\n# Interactive view (default in TTY)\nx lsof\n\n# fzf interactive search\nx lsof fz\n\n# TSV format output\nx lsof --tsv\n```\n\n---\n\n## Features\n\n- **Auto-download**: If `lsof` is not available, x-cmd automatically downloads a portable version from trusted sources\n- **Interactive UI**: TUI application for viewing open files\n- **fzf Integration**: Interactive search with fzf\n- **Multiple Formats**: TSV, CSV, and raw output for data processing\n- **Port-to-PID**: Fin",
  "cost": {
    "context_tokens": 609
  }
}

Fetch it by URL: GET /api/v1/registry/x-cmd-x-cmd-lsof/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.