Linux – How to Kill All Stopped Jobs

linuxshell

When I try to exit from my Linux server I get the message:

There are stopped jobs.

: Is there a single command to kill these?

Best Answer

To quickly kill all the stopped jobs under the bash, enter:

kill -9 `jobs -ps`

jobs -ps lists the process IDs (-p) of the stopped (-s) jobs.
kill -9 `jobs -ps` sends SIGKILL signals to all of them.