commands

kill — send a signal

Bash builtin sends TERM to the specified target. Signal acceptance does not prove exit; wait for a known child. Never copy a PID from another session. Use a fresh private workspace, ordinary user and bounded child processes; no sudo.

Formal Syntax & Structure

linux syntaxlinux
kill -TERM PID

Parameters & Attributes

NameTypeDescription
-TERMoptiontermination request
PIDoperandjust-started child

Return Value

exit status and output

Bash builtin sends TERM to the specified target. Signal acceptance does not prove exit; wait for a known child. Never copy a PID from another session.

Working Example

Example Snippetlinux
sleep 3 &child=$!kill -TERM "$child"if wait "$child"; then printf 'completed\n'; else printf 'status=%s\n' "$?"; fi
Linux Reference