Killing stopped jobs

Sometimes I’ve had to CTRL-Z my way out of a Linux (Centos) command line that won’t work, accumulating a list of stopped jobs. This makes exiting impossible because the server will report that there are stopped jobs.

Use the following command line to get a list of stopped jobs:

jobs

Then by applying the following, the job can be killed and terminated right away without resorting to a process id number. Just enter the corresponding jobs number after the percent sign:

kill -9 %1

Once all the stopped jobs are killed, you can exit gracefully.