I have started running a long job by creating a script that executes several commands on 20 or so datasets sequentially. I began in the xterm window with

$ script.scr

then typed


then called

$ bg

and then exited the window. I have now returned and started another xterm window and decided to kill the job, but when I identify the PID with top and then

$ kill PID

the current process PID is killed but the job then starts the next command line of the script.

I could manually then kill again the new PID created but since there are 20 or more similar command lines in the script this becomes tedious. Is there a short (efficient) way of killing the whole job?

$ killall PID just kills the current process then a new one starts just the

same as using kill.

$ killall script.scr does not have any effect

  • Does killing the job lead to the same results? kill %jobnumber
    – YoMismo
    Apr 15, 2015 at 9:03
  • Can you post the scrip.scr script here...if possible ?
    – SHW
    Apr 16, 2015 at 6:28

1 Answer 1


Execute the command killall script.scr

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .