Processes and PIDs
A process is a running program with a process ID, state, parent and resources. The shell can start a command in the background with &, and $! captures that new background job’s PID. ps inspects selected processes; jobs describes jobs managed by your current shell. Start sleep 120 & and immediately assign lab_pid=$!; ps -p "$lab_pid" -o pid,ppid,stat,args shows only that practice worker. Capturing the exact PID avoids broad process matching and lets you correlate a running command with its parent, state and eventual termination evidence safely. Using a broad killall pattern can terminate unrelated work; target the PID captured from your own harmless process rather than guessed process-name matches today.
Start sleep 120 & and immediately assign lab_pid=$!; ps -p "$lab_pid" -o pid,ppid,stat,args shows only that practice worker.
Capturing the exact PID avoids broad process matching and lets you correlate a running command with its parent, state and eventual termination evidence safely.
Using a broad killall pattern can terminate unrelated work; target the PID captured from your own harmless process rather than guessed process-name matches today.