Skip to main content

An application which scans a list of given pids and determines the executing user.

Each line on stdout contains the result, either a username or a uid (if –uid is specified, or a username cannot be determined from a uid), or “unknown” on complete failure (like invalid PID).

Error messages are on the same line, but in stderr, such that any script can use the stdout result and simply check for “unknown” instead of needing to parse the errors.

Usage

Usage: findProcessOwner (options) [pid1] (optional: pid2, pid3)

Prints the owner (account running) processes, given their pids. They are returned one per line on stdout.

Any errors reported go to stderr. If no owner can be determined, stdout will contain “unknown” for that line.

Thus your program can always ensure parsable output by parsing stdout, one-entry per line, and checking for “unknown”.

If a username can not be determined (like user deleted, or uid changed, etc) a pid will be printed.

Options:

--uid Print the UID instead of the username

--version Print the version

Examples:

findProcessOwner 1234

findProcessOwner --uid 1234 3231

Return:

Returns zero if all searches were successful, otherwise non-zero.

Examples

Current shell user:

$] findProcessOwner $$

myuser

Three processes, two invalid:

$] findProcessOwner 12345 $$ 12233

unknown (Could not determine owner of pid 12345)

myuser

unknown (Could not determine owner of pid 12233)

Three processes, two invalid, stderr nullified:

$] findProcessOwner 12345 $$ 12233 2>/dev/null

unknown

myuser

unknown

Metadata

Release files for findProcessOwner 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for findProcessOwner 1.0.1
File Size Uploaded
findProcessOwner-1.0.1.tar.gz 10.1 kB Details

Release files / findProcessOwner-1.0.1.tar.gz

Download URL findProcessOwner-1.0.1.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
31588a563387fdc4c89ef0cdd2aec9a205ae41516a859b948de9173bd2027a1b
BLAKE2b-256 checksum
How to use checksums
27ba0304c59c5c4dd4a5e1f24a17788fd0738d9879856f7e193faf5267df53f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page