poniedziałek, 19 października 2015

How To Find The Process ID Of A Program And Kill It

http://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/

It often happens that you need to kill an unresponsive program. In Windows you have task manager for this situation. In Linux one can use the terminal to kill a running or unresponsive program. Using the terminal is better than using any GUI based tool as GUI tools may not show the still running hidden process.



Find the process ID (PID) of a program:

Open the terminal in Ubuntu by using Ctrl+Alt+T. Now use the following command:
ps aux | grep -i “name of your desired program”
ps aux command returns all the running process on the system. And the grep afterwards shows the line which matches with the program name. The output of the command will be like this:
Find the PID of a process in Ubuntu Linux
As shown in the picture above, you can get the process ID of the program/process in the second column. Just ignore the line with “–color =auto”.

Kill the process:

Once you have the PID of the desired application, use the following command to kill the process:
sudo kill -9 process_id
If you have more than one process id, you can kill all of them together.

Brak komentarzy:

Prześlij komentarz