If you’re using a shell that supports job control (e.g., the C shell), then you don’t have to track down the process IDs of programs you want to kill. Instead, you can use their job ID.
Use the jobs command to see all background processes currently running for your shell.
% jobs [2] Running xlbiff [3] + Suspended (tty output) more ch01
The number in the first column, surrounded by square brackets, is the job ID of the process. To kill one of these processes, just list the job ID, preceded by the percent sign (%
). For example:
% kill %3 % jobs [2] + Running xlbiff