LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do you kill programs? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-you-kill-programs-290924/)

jawaking00 02-16-2005 08:24 AM

How do you kill programs?
 
Okay, every once and a while when I try running games through Cedega they hang and I am forced to kill them. Many times this requires switching to a different console and then trying to kill it from there because the game has completely hosed my current X session. The problem is, that most of the time pgrep and pkill don't successfully kill the window that the game was running in, so I am stuck with an ugly window in X and am forced to reboot.

Is there a better way to kill these so that the window actually goes away? Also, is there a better command than pgrep to find the ID of the program? Maybe something that lists the names of all programs running?

Thanks.

overlord73 02-16-2005 08:29 AM

u can use
ps -eff

have u tried
kill -9 PID ??

Wim Sturkenboom 02-16-2005 08:36 AM

I use ps -ef |grep whatever (where whatever is the name of the program you're looking for); this will give you the pid; if there are multiple pids, take the one with the lowest number (the parent process) but make sure that it really belongs to the process that you want to stop as pid might find more than you want. Next I use kill pid. If that's not sufficient, you can use kill -9 pid.

PS: Never heard of pgrep and pkill :scratch:

Too late :mad:


All times are GMT -5. The time now is 05:05 AM.