Stopping root job in batch


I am executing my root macro in batch mode using this command

root -b -q mymacro.C >& ouput.log </dev/null &

If i want to kill this job, how should I go for it?

When you start that root job, you should get something like this in your terminal window: “[3] 7982”. Using any of these two magic numbers you can kill your root: “kill %3” ("%3" is the “jobspec”) or “kill 7982” (“7982” is the “pid”).
See “man bash” and search for “pid”, “jobspec” and:
kill [-s sigspec | -n signum | -sigspec] [pid | jobspec]
Say simply “jobs -l” and you will get the current list of your running jobs (with their “jobspec” and “pid”).
Note that “jobspec” number is specific to your current shell / terminal, while “pid” is a system-wide number.

Awesome…thanks pepe…actually “kill %3”(for me it was 1) command works…

Also pkill might be usefull: