Home » Questions » Computers [ Ask a new question ]

'End Process' equivalent on linux

'End Process' equivalent on linux

Currently i am using the system monitor of gnome. It is like task manager, and has a function to end process, but sometimes this makes everything freeze and it locks up. Is there any way to fully end a process with command line faster?

Asked by: Guest | Views: 203
Total answers/comments: 5
Guest [Entry]

Try xkill, there's applet you could put to your panel. You just click on it, then click on the window of application you'd like to kill and it's gone instantly. Very handy.
Guest [Entry]

"You can use kill to send the desired signal to the process ID. You can find the process ID with pgrep, and send a signal to a named process with pkill. The pattern used to look for the process with pgrep and pkill is normally only matched against the process name. Specify -f to check the entire command line of the process. Start with a TERM signal (it's the default if no signal is specified) before using KILL ('9'), as outright killing a process may have undesirable side effects.

For sake of example, I'll use the dhclient3 process on my system.

Old way, ps | grep:

$ ps awux | grep dhclient3
root 2539 0.0 0.1 2200 220 ? S<s Jul28 0:00 dhclient3 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp3/dhclient.eth0.leases eth0
1000 12734 0.0 0.5 3184 732 pts/3 R+ 21:58 0:00 grep dhclient3

Kill the dhclient:

$ kill -9 2539

With pgrep/pkill:

$ pgrep dhclient
2539

With -f to specify a pattern anywhere in the commandline:

$ pgrep -f leases
2539

Kill the dhclient process with pkill (signal before -f pattern):

$ pkill -f dhclient3
$ pkill -9 -f dhclient3

About signals (from the kill man page):

The default signal for kill is TERM. Use -l or -L to list available
signals. Particularly useful signals include HUP,
INT, KILL, STOP, CONT, and 0. Alternate signals may be specified in
three ways: -9 -SIGKILL -KILL. Negative PID val‐
ues may be used to choose whole process groups; see the PGID
column in ps command output. A PID of -1 is special; it
indicates all processes except the kill process itself and init."
Guest [Entry]

"Note that if the hanged process is a window, you have a ""button"" to add in Gnome toolbar, to terminate a process (you click on it, then on the concerned window)

edit : ""Force Quit"" is the name of it"
Guest [Entry]

You want psdoom. This is a first-person shooter game in which the monsters are associated with a pid. Killing a monster sends a SIGKILL to the associated process. It is perhaps not the most efficient way to kill a process, but it may be the most entertaining.
Guest [Entry]

"I would also like to add xkill. When call this from a terminal ( or a run command prompt) your cursor will change into a skull or crossbones icon, or an ""X"" icon. And then the next time you click on a window (any window) that application will get killed.

I found this command to be a little more intuitive and user friendly."