Skip to main content

Show the executable path for matching processes

Project description

License: MIT GitHub followersBluesky followersYouTube Channel Subscribers

whereproc

A small, cross-platform command-line tool to locate the executable path of a running process.

It gives you:

  • PID lookup
  • Process-name matching (substring / exact / regex)
  • Command-line matching
  • JSON output
  • A quiet mode for scripting (--quiet → just print the process path)

Why?

Because sometimes you just want a dead-simple way to answer: “What executable is actually backing this process?”

Useful for:

  • debugging PATH issues
  • finding the real location of app bundles / snap packages
  • scripting around PID or exe discovery
  • process verification and automation

Installation

pipx (recommended)

pipx install whereproc

From source

git clone https://github.com/dorktoast/whereproc.git
cd whereproc
pipx install .

Usage

Basic substring match

whereproc firefox
PID    NAME     EXE
----------------------------------------------------------
75032  firefox  /snap/firefox/7355/usr/lib/firefox/firefox

Quiet Mode (print only path)

Useful for scripts!

whereproc --quiet firefox
/snap/firefox/7355/usr/lib/firefox/firefox

Exact Name match

whereproc --exact python3.12

Regex name match

whereproc --regex "python(3\.\d+)?"

Match against command line instead of process name

whereproc --cmd /snap/firefox

Regex on command line

whereproc --cmd --regex "snap.*firefox"

First-match output

When you don’t care about multiple processes.

whereproc --first firefox

Full command line

whereproc --cmdline firefox

JSON output

whereproc --json firefox
[
  {
    "pid": 75032,
    "name": "firefox",
    "exe": "/snap/firefox/7355/usr/lib/firefox/firefox",
    "cmdline": [
      "/snap/firefox/7355/usr/lib/firefox/firefox",
      "--some-arg"
    ]
  }
]

PID Search

If the query is an integer, it is treated as a PID.

whereproc 75032

Return Codes

  • 0 → at least 1 match found
  • 1 → no match

Requirements

  • Python ≥ 3.8
  • psutil

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whereproc-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whereproc-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file whereproc-0.1.0.tar.gz.

File metadata

  • Download URL: whereproc-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for whereproc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aadd549d886fafca83b44ba74fe86471eb73e3cd78215ad9e22f779238a64bd0
MD5 c6e2460eb867ab78d967db8e7e1cb8b5
BLAKE2b-256 e2750d4ea099e0c6c734484c1069cf1b7921fe855b0d228100b9295c4d61592f

See more details on using hashes here.

File details

Details for the file whereproc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: whereproc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for whereproc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29c14e019dc3c5eaf1daf3513865ea59ee167dd3b0e40d9c532868cfd9800bcf
MD5 ed805e4e8868d2bff85409350eaf93b8
BLAKE2b-256 fc3cdd0cfad9c59c8482f1754fae37afe00eab4f3bb3b60e5636e588cc6dadc2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page