Ubuntu – the difference between using System Monitor and Terminal to kill a process

command linekillprocesssystem-monitor

When I shutdown my minecraft it never closes all the way, I have looked for a solution but found none. After awhile I gave up and decided that I would manually kill it when I wanted to close it.

If I use pgrep then kill in the terminal it seems to have no affect, but when I open the system monitor and right click and kill it, it shuts down nicely.

What are the differences between the System Monitor way and the Terminal way? Does the System Monitor do something else in the background that the kill command does not?

Best Answer

There is no difference between the kill command and the System Monitor's 'kill'. The System Monitor just gives some arguments to kill that I assume you don't know.

When you kill <process-number>, it's actually sending a signal to that process to cleanly exit. This is called a SIGTERM. In order to kill a process unconditionally, potentially causing data loss, you need to send a different signal:

kill -9 <process-number>

This sends a SIGKILL to the process, which immediately ends its execution. System Monitor uses kill -9 when you ask to 'kill' a process rather than simply 'close' it.

This answer on the SuperUser Stack Exchange should be of help.