On Tuesday 20 March 2007 10:28, Jay C Vollmer wrote:
> ...

Note that in most cases, this approach will find the grep process, too.

"Pidof" is the direct way to find process IDs as such.


> The output from this command will list the PIDs of the matching
> processes and the PIDS of the parents of those processes - like this:
>
> $ ps -eaf|grep xterm
> jvollmer 30239 30215  0 12:07 pts/2    00:00:00 xterm
> jvollmer 30257 30215  0 12:07 pts/2    00:00:00 grep xterm
>
> (the first number for each process is the PID, the second is the PID
> of the parent)

Another reason that "ps" is less than ideal for this purpose. There are 
too many similar numbers in the output and when you filter ps output 
with grep, you don't see the column headers. If you send the signal to 
the process group (the other number right next to the PID), you'll not 
get the results you want and you probably will not like the results you 
get.


> Locate the PID for the process you wish to terminate and use the
> 'kill' command:
>
>       kill -9 <PID>

Absolutely a bad idea. Many programs have clean-up operations to 
perform. This guarantees those clean-up actions will not take place.

Signal TERM or 15 is the clean way to kill a process. Only resort to 
KILL or 9 when TERM does not cause the process to terminate.


> ...


Randall Schulz
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to