pkill

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(w io.Writer, pattern string, opts Options) error

Run executes the pkill command

Types

type Options

type Options struct {
	Signal     string // -signal: signal to send (default: TERM)
	Exact      bool   // -x: match exactly
	Full       bool   // -f: match against full command line
	Newest     bool   // -n: select only the newest process
	Oldest     bool   // -o: select only the oldest process
	Count      bool   // -c: count matching processes
	ListOnly   bool   // -l: list matching processes (don't kill)
	User       string // -u: only match processes owned by user
	Parent     int    // -P: only match processes with given parent PID
	Terminal   string // -t: only match processes on terminal
	Verbose    bool   // -v: verbose output
	JSON       bool   // -j: output as JSON
	IgnoreCase bool   // -i: case insensitive matching
}

Options configures the pkill command behavior

type Result

type Result struct {
	PID     int    `json:"pid"`
	Name    string `json:"name"`
	Cmdline string `json:"cmdline,omitempty"`
	Signal  int    `json:"signal,omitempty"`
	Matched bool   `json:"matched"`
	Killed  bool   `json:"killed,omitempty"`
	Error   string `json:"error,omitempty"`
}

Result represents the result of a pkill operation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL