Quote:
Originally posted by skrishnaswamy
If you do an fg you can bring the process to the foreground.
if you do a bg you can put it to the background.
Eg
# somescript &
[1] 17921
# kill %1
will kill that process.
Srikanth
|
That's a good way to kill one process, but if there's multiple background jobs, some of which you don't want to kill, it'll not work.
The shell should have a 'jobs' command which lists all the commands running in the background for this instance of the shell, rather than the machine's whole process table. You can munge that output and kill the relevant ones:
for i in `jobs | grep my-db-stress-script | sed -e 's/\].*$//' -e 's/^.*\[//'`; do eval kill %$i; done
For killing a particular process, "kill <pid>" works as in most *nix.
"kill -9" is too aggresive a command to remove a process and all it's children, it kills the process immediately. "man kill" or "man signal" should give you more info on the severity of signals.