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.
Written by Adam Stankiewicz
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#