Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

skill

Send a signal to processes selected by user, tty, pid, or command.

Description

skill is the obsolete predecessor of pkill; both tools are kept for compatibility, but new use cases should prefer pkill. The CLI follows procps-ng’s quirky convention where the signal is given as a leading -NAME or -N argument (e.g. skill -KILL -u alice), like kill(1).

The default signal is TERM. Selectors (-t, -u, -p, -c) are OR’d within their category and AND’d across categories.

Inputs

  • kill(2) syscall via libc::kill for delivery.
  • /proc/[pid]/{stat,status,cmdline} via the shared procmatch module for selection.

Synopsis

skill [signal] [options] <expression>

expression is a list of bare PIDs (interpreted in conjunction with -p). Selectors with explicit flags can be mixed with bare PIDs.

Arguments

FlagDescription
-<SIG> (e.g. -9, -KILL, -SIGKILL)Signal to send. Default: TERM
--signal SIGSame as the leading-flag form, but in long-flag style
-l, --listList all signal names
-L, --tableList all signal names in a numbered table
-n, --no-actionDon’t send signals; just print matching PIDs
-v, --verbosePrint the PID and comm of each signaled process
-t, --tty TTYMatch processes whose controlling tty is TTY (repeatable)
-u, --user USERMatch processes whose effective user is USER (name or numeric UID, repeatable)
-p, --pid PIDMatch processes by PID (repeatable)
-c, --command CMDMatch processes whose comm is exactly CMD (repeatable)
--help / -V, --versionHelp / version

The signal can appear anywhere on the command line; it is rewritten internally to --signal SIG before clap parses argv (see preprocess_argv). Bare positional integers are added to the PID list.

Behavior

Selection

procmatch::find_matching_processes is used to enumerate /proc and apply filters. -c values are turned into an anchored alternation regex over comm (^(cmd1|cmd2|...)$). -p values become an exact PID filter.

-l / -L

Identical output to kill -l / kill -L. Standard signals 1–31 only; real-time signals are omitted.

-n (no-action)

Prints matching PIDs, one per line, in ascending order. Useful as a dry-run before signaling.

-v (verbose)

For each successfully signaled process, prints pid: comm.

Notes

  • -i (interactive), -f (fast), -w (warnings) and --ns / --nslist (namespace selection) are listed in the upstream man page but not implemented here.
  • Real-time signals (SIGRTMIN..SIGRTMAX) cannot currently be expressed via name; they can be sent via --signal N for the corresponding number.

Exit codes

CodeMeaning
0At least one process matched and was signaled (or list/table requested)
1No processes matched, or all signal deliveries failed
2Usage error (unknown signal, no expression given, invalid argument)