Last Updated: February 25, 2016
·
104.5K
· sheerun

How to kill background or suspended shell job?

First, decide which job you want to kill:

jobs    # list all jobs
jobs -r # list running jobs
jobs -s # list suspended jobs

Now, you can use shell's kill built-in (not /bin/kill) to kill the job:

kill %1

Where %1 is the number of job as read from jobs command.

You can also use jobs -l to list PIDs and use kill command as usual.