Friday, September 29, 2006

Display and force quit/terminate a program/services running on background
Where windows Alt + Ctrl + Del doesn't applied in Linux

The situation: While working on some application, you might stumble into a situation where you need to force terminate a running application or services. It is easy to do it in Windows, simply by pressing Alt + Ctrl + Del combination.

The Problem: How do I terminate a running program (including a background program and services) in Linux?

The Solution: The process is simple. Everything can be done in terminal. (Image example coming soon)

First, open the terminal, and to see currently running processes and application running, use the top command :

me@localhost:~#: top


You will be displayed the currently running processes in real-time. Just like Alt + Ctrl + Del combination in Windows.

Second, please take note of the processes you wish to terminate (or kill in Linux), and identify the process number (in the respective column), For example superkaramba application is running with process number 3349.

Press the "Q" button on your keyboard to quit top. Finally, type in the command #kill followed by the process number

me@localhost:~#: kill [process number]


For our example, it will be:

me@localhost:~#: kill 3349


NOTE: Sometime you just can't simply terminate a running application/processes. You can accomplish this by force kill. Here how you do it


me@localhost:~#: kill - 9 [process number]


Yeah, simple add -9 attributes (right after the kill command). In our example


me@localhost:~#: kill -9 3349

0 Comments:

Post a Comment

<< Home