Last Updated: February 25, 2016
· sheerun
Photo on 08.01.2013 at 04.15

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.

Say Thanks
Filed Under