How to Kill a Process on a Unix Computer
Each task or application that is run on a Unix computer, whether started by a user or the system, is called a process. Each process is given a unique number (the PID) so that the operating system can keep track of what the process is doing and how the resources should be allocated. Each process also has an owner. Tasks or applications that are started by a user are owned by that user. The root user can kill, or stop, any process that is running. Each user can only stop the processes that are owned by that user.
Instructions
-
-
1
Open a terminal session. This is where you will type the following commands.
-
2
Type the command "ps -aux" to locate the process. This will show a list of all the processes running on the computer, along with the PID (process identification number). If you know the name of the application, you can combine the "ps" command with the "grep" command. For example, "ps -aux | grep firefox" will find the processes being used by the Firefox application. You will need the PID of the process for the following command.
-
-
3
Type the command "kill <PID>" to kill the process. Replace "<PID>" with the PID number for that process. For example, if the PID is "22177," you would type "kill 22177" to stop that process.
-
4
Type the command "ps -aux" a second time to ensure that the process has been stopped.
-
5
Type "exit" to close the terminal session.
-
1
Tips & Warnings
You can also use the "pidof" command to find the PID of a certain process as long as you know the name of the process (e.g. "pidof firefox").