Kill snoops running in background

Hi,

I want to run 2 snoop commands in the background and would like to be able to kill them when I want to. What is the best way to do that at the command line?

if I do a fg at the terminal, will that bring only the snoop that I got running myself so I stop them with a CTRL_C or will that bring other possible processes running in the background?

You can see what background jobs are running, using:

jobs

And you can kill them with:

kill %1
kill %2
etc.

Or bring them to the foreground, or background with:

fg %1
bg %1
etc.

fg will only bring jobs you started in the current shell to the foreground, not any other process.

If you want to kill something else you should use the ps and grep commands to find the PID, and then kill that.

If you have no other snoop running you want to keep alive, a simple way to kill all of the running ones would be:

pkill snoop