long_task &Launch a command as a background job.
Linux signals, process groups, shell job control, and safe batch-termination patterns.
Move jobs between foreground and background from interactive shells.
long_task &Launch a command as a background job.
jobs -lShow background and stopped jobs with PIDs.
fg %1Resume a job in the foreground.
bg %1Continue a stopped job in the background.
# Press Ctrl+Z in the terminalSuspend the current foreground process group.
disown %1Prevent the shell from sending SIGHUP to the job on exit.
wait 1234Block until a background PID exits.
wait %1Block until a shell job completes.
Work with standard Unix signals and process groups.
trap "echo caught INT" INTHandle a signal in a shell script.
kill -- -1234Signal every process in a process group.
pkill -o -TERM myworkerSignal only the oldest matching process.
pkill -n -HUP nginxSignal the newest matching process.
pgrep -c sshdCount processes that match a pattern.
pkill -USR1 myappSend a custom signal to matching processes.
kill -0 1234Check whether a process exists and whether you can signal it.
Terminate groups of processes safely and predictably.
pkill -x ssh-agentOnly match an exact process name.
pkill -P 1234Signal all child processes of a parent.
killall -u alice pythonLimit killall by user and executable name.
killall -r "worker[0-9]+"Use a regex pattern with killall where supported.
lsof -ti :3000 | xargs -r -n1 kill -TERMCombine lsof and xargs to terminate port users.