|
|
#1 |
|
Triple-A Player
Join Date: Jun 2003
Posts: 65
|
Does anyone know how I can derive a process ID given only it's name. The big picture is that I want to kill a process but I only know the name, not the process ID. It seems that "kill" requires the PID.
Any and all help would be appreciated. Thanks |
|
|
|
|
|
#2 |
|
Major Leaguer
Join Date: Feb 2003
Location: Berkeley, CA
Posts: 270
|
Well, you can do this in the Terminal:
ps -auwx | grep 'Name of Process' |
|
|
|
|
|
#3 |
|
All Star
Join Date: Feb 2003
Location: Chico, CA
Posts: 686
|
|
|
|
|
|
|
#4 |
|
Triple-A Player
Join Date: Feb 2003
Posts: 55
|
Read the above linked thread, and if it's too long or not understandable, just read the last post in that thread.
It is really easy using just killall. |
|
|
|
|
|
#5 |
|
All Star
Join Date: Feb 2003
Location: Chico, CA
Posts: 686
|
Ditto what Englabenny said. Thought you might want some background though...
|
|
|
|
|
|
#6 |
|
Prospect
Join Date: Jul 2002
Posts: 14
|
here's an AppleScript that may help...
Code:
display dialog "Enter the Name of the Application You Wish to Kill" default answer "" set appName to (text returned of result) do shell script "ps ax | grep -i " & appName & " | grep -v grep | cut -c 1-6" set pNum to result set prName to do shell script "ps cax | grep -i " & appName & " | awk '{print $5, $6}'" display dialog "Kill Application " & prName & " PID#" & pNum buttons {"Kill It!", "Cancel"} if button returned of result is "Kill It!" then try do shell script "kill -15 " & pNum on error display dialog "The Process Named \"" & appName & "\" Is Not Running" end try end if |
|
|
|
![]() |
|
|