Thursday, July 29, 2010

linux job control - kill a topped job

it is well known that when a process is running it can be stopped using ctrl-z

you can have in this way many stopped jobs, which you can see using the 'jobs' command

you can kill anyone of this jobs by issuing "kill %n", where n is the number of the job as listed by jobs...

fg put the job to foreground and activate the process again
jobs display your stopped/backgrounded jobs
kill %1 send signal TERM to the job numbered %1 in the job list

Janis

taken from: http://www.issociate.de/board/goto/842834/what_is_the_command_to_kill_suspended_job.html

cancel script completely on ctrl-c

I found this question interesting: basically how to cancel completely a script and all child processes : You do this by creating a subro...