{"id":23021,"date":"2023-10-31T07:11:43","date_gmt":"2023-10-31T07:11:43","guid":{"rendered":"https:\/\/linuxways.net\/?p=23021"},"modified":"2023-10-31T07:16:21","modified_gmt":"2023-10-31T07:16:21","slug":"kill-processes-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/kill-processes-ubuntu-22-04\/","title":{"rendered":"How to Kill Processes in Ubuntu 22.04?"},"content":{"rendered":"<p>While Working with Multiple Programs in Ubuntu, the system resources sometimes get limited. Either you run out of RAM Memory, or you run out of CPU Memory. Also, closing an Application or a Process on your Ubuntu System does not usually Kill or Terminate all the processes of the Application. The Application still runs in the Background consuming system resources which eventually increases the memory usage leading to a slower system. Thus, it is necessary to kill all the running processes of your Ubuntu System to run efficiently.<\/p>\n<p>This article explains the killing of processes in various methods.<\/p>\n<h2><strong>How to Kill Processes in Ubuntu 22.04?<\/strong><\/h2>\n<p>Ubuntu allows the User to Kill or terminate a specific process or multiple processes either through the GUI or through the Terminal. To Kill a Process in Ubuntu, the methods used are:<\/p>\n<ul>\n<li>Killing a Process through GUI by using the System Monitor Application.<\/li>\n<li>Killing a Process using the \u201ckill\u201d Command.<\/li>\n<li>Killing a Process using the \u201ckillall\u201d Command.<\/li>\n<li>Killing a Process using the \u201cpkill\u201d Command.<\/li>\n<\/ul>\n<p>All the methods are deliberated in detail in the sections below.<\/p>\n<h2><strong>Method 1: Killing a Process in Ubuntu through GUI<\/strong><\/h2>\n<p>The Ubuntu GUI offers the System Monitor pre-installed application which lists all the running processes on your Ubuntu System. To start the System Monitor application, navigate to the Application Menu from your Ubunut Home Screen by clicking on the Application menu Icon:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1080\" class=\"wp-image-23022\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-1.png 1920w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-1-300x169.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-1-1024x576.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-1-768x432.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-1-1536x864.png 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>In the Application Menu, type \u201cSystem Monitor\u201d in the top search bar. The System Monitor Application will filter out. Click on the Application Icon to start the System Monitor Application:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1062\" height=\"383\" class=\"wp-image-23023\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-2.png 1062w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-2-300x108.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-2-1024x369.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-2-768x277.png 768w\" sizes=\"auto, (max-width: 1062px) 100vw, 1062px\" \/><\/p>\n<p>In the System Monitor Application, you will see the Resources Tab opened. In the Resources tab, you will see the CPU usage, the network usage, and the Memory usage:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"502\" class=\"wp-image-23024\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-3.png 703w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-3-300x214.png 300w\" sizes=\"auto, (max-width: 703px) 100vw, 703px\" \/><\/p>\n<p>To view the running Processes on your Ubuntu System, click on the Processes Tab available next to the Resources Tab:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"502\" class=\"wp-image-23025\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-4.png 703w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-4-300x214.png 300w\" sizes=\"auto, (max-width: 703px) 100vw, 703px\" \/><\/p>\n<p>After you click on the Processes Tab, the Processes Menu will appear where you will see all the Processes currently running are listed. The Listed Processes will also contain the Process ID, the process user, and the Memory and CPU usage utilized by the processes:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1050\" height=\"501\" class=\"wp-image-23026\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-5.png 1050w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-5-300x143.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-5-1024x489.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-5-768x366.png 768w\" sizes=\"auto, (max-width: 1050px) 100vw, 1050px\" \/><\/p>\n<p>To kill a process from the System Monitor, click on any process among the list of processes. In our case, we will click on the \u201cfirefox\u201d application process:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1048\" height=\"497\" class=\"wp-image-23027\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-6.png 1048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-6-300x142.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-6-1024x486.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-6-768x364.png 768w\" sizes=\"auto, (max-width: 1048px) 100vw, 1048px\" \/><\/p>\n<p>Once you click on a process, you will notice a \u201cEnd Process\u201d Button at the bottom of the System Monitor Window:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1049\" height=\"499\" class=\"wp-image-23028\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-7.png 1049w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-7-300x143.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-7-1024x487.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-7-768x365.png 768w\" sizes=\"auto, (max-width: 1049px) 100vw, 1049px\" \/><\/p>\n<p>Click on the \u201cEnd Process\u201d button and a new window will pop up asking for the confirmation to end the process. Click on the \u201cEnd Process\u201d option to end the selected process:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1048\" height=\"499\" class=\"wp-image-23029\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-8.png 1048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-8-300x143.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-8-1024x488.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-8-768x366.png 768w\" sizes=\"auto, (max-width: 1048px) 100vw, 1048px\" \/><\/p>\n<p>Once the process ends, you can verify through the Processes List again as the Application will not be listed again:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1047\" height=\"501\" class=\"wp-image-23030\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-9.png 1047w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-9-300x144.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-9-1024x490.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-9-768x367.png 768w\" sizes=\"auto, (max-width: 1047px) 100vw, 1047px\" \/><\/p>\n<p>Apart from Ending a Process, you can also check the details of a Process. In our case, we will check the \u201cbaobab\u201d Application Details:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1046\" height=\"500\" class=\"wp-image-23031\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-10.png 1046w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-10-300x143.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-10-1024x489.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-10-768x367.png 768w\" sizes=\"auto, (max-width: 1046px) 100vw, 1046px\" \/><\/p>\n<p>Once the application process is selected, click on the \u201cSettings\u201d gear icon at the bottom right of the System Monitor Window:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1052\" height=\"502\" class=\"wp-image-23032\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-11.png 1052w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-11-300x143.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-11-1024x489.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-11-768x366.png 768w\" sizes=\"auto, (max-width: 1052px) 100vw, 1052px\" \/><\/p>\n<p>After you click on the Settings Icon, the details of the Application will open in a new window where you can see the Status of the Application, The Memory Usage, the Process ID, and many more:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"936\" height=\"509\" class=\"wp-image-23033\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-12.png 936w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-12-300x163.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-12-768x418.png 768w\" sizes=\"auto, (max-width: 936px) 100vw, 936px\" \/><\/p>\n<h2><strong>Method 2: Killing a Process in Ubuntu through CLI<\/strong><\/h2>\n<p>The Terminal in Ubuntu offers multiple commands to kill a running process. Killing a process from the Terminal is also much more useful, as, with the Terminal Commands, you can kill the specific process ID of an Application and you can also forcefully kill a Process.<\/p>\n<h3><strong>List Running Processes<\/strong><\/h3>\n<p>Before Killing a Process in Ubuntu through the Terminal, you have to list the running Processes in your Ubuntu system. To list the running processes, use the \u201cps aux\u201d command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ps<\/span> aux<\/div><\/div>\n<p>The list of processes currently running will be listed in Ascending Order in the Terminal. Note that the Processes Listed will be in Ascending Order According to their Process IDs:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"409\" class=\"wp-image-23034\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-13.png 814w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-13-300x151.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-13-768x386.png 768w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" \/><\/p>\n<p>With the \u201cps aux\u201d command, you can also list the Running Processes of a specific Application as well. In our case, to list the running processes of the \u201cfirefox\u201d application in the Terminal, the \u201cps aux\u201d command will be used along with the \u201cgrep\u201d command to filter the list:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ps<\/span> aux <span class=\"sy0\">|<\/span> <span class=\"kw2\">grep<\/span> firefox<\/div><\/div>\n<p>All the Running Processes along with the process IDs of the Firefox Application will appear in the Terminal:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"812\" height=\"407\" class=\"wp-image-23035\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-14.png 812w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-14-300x150.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-14-768x385.png 768w\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" \/><\/p>\n<p>Apart from the \u201cps aux\u201d command, the \u201ctop\u201d command is also useful to list the running processes in your Terminal. The advantage of the \u201ctop\u201d command over the \u201cps aux\u201d is that with the \u201ctop\u201d command, the Terminal Displays the Processes in a way similar to the System Monitor. To display the processes, simply use the \u201ctop\u201d command in the Terminal:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">top<\/div><\/div>\n<p>The Terminal will display the list of running processes where you can also see the Memory Usage of the Applications:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"403\" class=\"wp-image-23036\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-15.png 814w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-15-300x149.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-15-768x380.png 768w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" \/><\/p>\n<h2><strong>Approach 1: Using the \u201ckill\u201d Command<\/strong><\/h2>\n<p>The \u201ckill\u201d is a useful command for terminating or killing running processes manually. The \u201ckill\u201d command simply takes the Process ID of a running process and Terminates it. The syntax of the \u201ckill\u201d command is:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">kill<\/span> <span class=\"sy0\">&lt;<\/span>options<span class=\"sy0\">&gt;<\/span> <span class=\"sy0\">&lt;<\/span>processID<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>Before killing a process of an Application, run the \u201cpidof\u201d command to list the processes of a specific application:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">pidof<\/span> <span class=\"sy0\">&lt;<\/span>application<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>In our case, we will list the processes of the \u201cfirefox\u201d application. To list all the processes, use the \u201cpidof\u201d command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">pidof<\/span> firefox<\/div><\/div>\n<p>All the running processes of the \u201cfirefox\u201d application will be listed in the Terminal:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"813\" height=\"218\" class=\"wp-image-23037\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-16.png 813w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-16-300x80.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-16-768x206.png 768w\" sizes=\"auto, (max-width: 813px) 100vw, 813px\" \/><\/p>\n<p>You can now kill a process according to your own choice. Either you can kill only one process, or you can kill multiple processes with the syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">kill<\/span> <span class=\"sy0\">&lt;<\/span>option<span class=\"sy0\">&gt;<\/span> <span class=\"sy0\">&lt;<\/span>processID-<span class=\"nu0\">1<\/span><span class=\"sy0\">&gt;<\/span> <span class=\"sy0\">&lt;<\/span>processID-<span class=\"nu0\">2<\/span><span class=\"sy0\">&gt;<\/span> ... <span class=\"sy0\">&lt;<\/span>processID-N<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>If you want to Forcefully Kill a Process, Use the \u201c<strong>SIGKILL<\/strong>\u201d command along with the \u201ckill\u201d command. Instead of the \u201cSIGKILL\u201d command, the signal \u201c<strong>-9<\/strong>\u201d can be used as an option with the \u201ckill\u201d command. Note that the SIGKILL and the signal \u201c-9\u201d are the same. To forcefully kill a process, use the \u201c-9\u201d option with the \u201ckill\u201d command along with the process ID:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">kill<\/span> <span class=\"re5\">-9<\/span> <span class=\"sy0\">&lt;<\/span>processID<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>In our case, we will forcefully kill the \u201c3762\u201d Process ID of the Firefox Application. To forcefully kill the Process ID 3762, the \u201ckill\u201d command along with the \u201c-9\u201d signal will be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">kill<\/span> <span class=\"re5\">-9<\/span> <span class=\"nu0\">3762<\/span><\/div><\/div>\n<p>The cursor moving to the next line indicates that the process ID was terminated or killed:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"822\" height=\"123\" class=\"wp-image-23038\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-17.png 822w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-17-300x45.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-17-768x115.png 768w\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" \/><\/p>\n<p>You can verify the Killed Process ID with the \u201cpidof\u201d command. In our case, to verify the killed process of \u201cfirefox\u201d, the \u201cpidof\u201d command will be used again:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">pidof<\/span> firefox<\/div><\/div>\n<p>As you can see, the Process ID 3762 is not listed again indicating that the process was Killed: <img loading=\"lazy\" decoding=\"async\" width=\"813\" height=\"169\" class=\"wp-image-23039\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-18.png 813w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-18-300x62.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-18-768x160.png 768w\" sizes=\"auto, (max-width: 813px) 100vw, 813px\" \/><\/p>\n<p>If you are not comfortable with using the \u201c-9\u201d signal, you can use the \u201cSIGKILL\u201d Command along with the \u201ckill\u201d command as well, having the syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">kill<\/span> <span class=\"re5\">-s<\/span> SIGKILL <span class=\"sy0\">&lt;<\/span>processID<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>In our case, to forcefully kill the Process ID 3759 of the Firefox Application, the SIGKILL Command will be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">kill<\/span> <span class=\"re5\">-s<\/span> SIGKILL <span class=\"nu0\">3759<\/span><\/div><\/div>\n<p>The cursor moving to the next line indicates the process was killed or terminated successfully:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"169\" class=\"wp-image-23040\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-19.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-19.png 816w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-19-300x62.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-19-768x159.png 768w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><\/p>\n<p>To verify the killed process ID, use the \u201cpidof\u201d command again with the application name, in our case, \u201cfirefox\u201d:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">pidof<\/span> firefox<\/div><\/div>\n<p>As you can see in the Terminal, the Process ID 3759 was Terminated or Killed:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"812\" height=\"200\" class=\"wp-image-23041\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-20.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-20.png 812w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-20-300x74.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-20-768x189.png 768w\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" \/><\/p>\n<p>The SIGKILL Command can also be used along with the \u201ckill\u201d command to terminal or kill multiple processes at a time with the syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">kill<\/span> <span class=\"re5\">-s<\/span> SIGKILL <span class=\"sy0\">&lt;<\/span>processID-<span class=\"nu0\">1<\/span><span class=\"sy0\">&gt;<\/span> <span class=\"sy0\">&lt;<\/span>processID-<span class=\"nu0\">2<\/span><span class=\"sy0\">&gt;<\/span> ... <span class=\"sy0\">&lt;<\/span>processID-N<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>In our case, to kill multiple processes of the Firefox Application running on our Ubuntu System, the \u201ckill\u201d command along with the SIGKILL command will be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">kill<\/span> <span class=\"re5\">-s<\/span> SIGKILL <span class=\"nu0\">3599<\/span> <span class=\"nu0\">3480<\/span> <span class=\"nu0\">3458<\/span> <span class=\"nu0\">3296<\/span><\/div><\/div>\n<p>This will forcefully kill the multiple processes:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"228\" class=\"wp-image-23042\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-21.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-21.png 811w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-21-300x84.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-21-768x216.png 768w\" sizes=\"auto, (max-width: 811px) 100vw, 811px\" \/><\/p>\n<p>To verify if the processes were killed, use the \u201cpidof\u201d command again to list the running processes of the \u201cfirefox\u201d application:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">pidof<\/span> firefox<\/div><\/div>\n<p>As nothing is returned in the Terminal, it ensures that all the processes of the Firefox Application were forcefully killed with the SIGKILL command:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"239\" class=\"wp-image-23043\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-22.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-22.png 814w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-22-300x88.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-22-768x225.png 768w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" \/><\/p>\n<h2><strong>Approach 2: Using the \u201ckillall\u201d Command<\/strong><\/h2>\n<p>Instead of Terminating or Killing all the processes by writing the Process ID one by one with the \u201ckill\u201d command, the \u201ckillall\u201d command can be used. The \u201ckillall\u201d command will kill all the running processes of the Running Application or Process. To kill or terminate all the processes of a Process or an Application, the \u201ckillall\u201d command will have the syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">killall<\/span> <span class=\"sy0\">&lt;<\/span>processName<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>In our case, to list all the running processes of the Firefox Application, the \u201cpidof\u201d command will be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">pidof<\/span> firefox<\/div><\/div>\n<p>All the Running Firefox Processes will be displayed in the Terminal:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"813\" height=\"121\" class=\"wp-image-23044\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-23.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-23.png 813w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-23-300x45.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-23-768x114.png 768w\" sizes=\"auto, (max-width: 813px) 100vw, 813px\" \/><\/p>\n<p>Now, to kill all the running processes of the Firefox Application, the \u201ckillall\u201d command will be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">killall<\/span> firefox<\/div><\/div>\n<p>The cursor will move to the next line once the \u201ckillall\u201d command kills the running processes of Firefox:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"170\" class=\"wp-image-23045\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-24.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-24.png 816w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-24-300x63.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-24-768x160.png 768w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><\/p>\n<p>To verify if the processes were killed with the \u201ckillall\u201d command, use the \u201cpidof\u201d command again which will list the running processes of Firefox:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">pidof<\/span> firefox<\/div><\/div>\n<p>As no running processes are displayed in the Terminal, it ensures that all the processes were killed:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"821\" height=\"171\" class=\"wp-image-23046\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-25.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-25.png 821w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-25-300x62.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-25-768x160.png 768w\" sizes=\"auto, (max-width: 821px) 100vw, 821px\" \/><\/p>\n<p>You can also forcefully kill all the processes using the \u201cSIGKILL\u201d command along with the \u201ckillall\u201d command having the syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">killall<\/span> <span class=\"re5\">-s<\/span> SIGKILL <span class=\"sy0\">&lt;<\/span>processName<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>In our case, to kill all the processes of the Firefox Application, the SIGKILL Command will be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">killall<\/span> <span class=\"re5\">-s<\/span> SIGKILL firefox<\/div><\/div>\n<p>This will forcefully kill all the running processes of the Firefox Application:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"165\" class=\"wp-image-23047\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-26.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-26.png 814w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-26-300x61.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-26-768x156.png 768w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" \/><\/p>\n<h2><strong>Approach 3: Using the \u201cpkill\u201d Command<\/strong><\/h2>\n<p>The \u201cpkill\u201d command is also a useful command to kill or terminate a running process on Ubuntu through the Terminal. The \u201cpkill\u201d command will kill all the running processes of an Application. To use the \u201cpkill\u201d command, use the Process or the Application name along with the \u201cpkill\u201d command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">pkill <span class=\"sy0\">&lt;<\/span>processName<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>In our case, to kill all the running Processes of the \u201cfirefox\u201d application, the \u201cpkill\u201d command will be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">pkill firefox<\/div><\/div>\n<p>The cursor moves to the next line indicating the processes were killed or terminated:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"156\" class=\"wp-image-23048\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-27.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-27.png 811w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-27-300x58.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-27-768x148.png 768w\" sizes=\"auto, (max-width: 811px) 100vw, 811px\" \/><\/p>\n<p>To verify, use the \u201cpidof\u201d command again. In our case, no processes are returned, ensuring that all the running processes of Firefox were Killed:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"169\" class=\"wp-image-23049\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-28.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-28.png 814w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-28-300x62.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-28-768x159.png 768w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" \/><\/p>\n<p>You can also Forcefully Kill a Process using the \u201cSIGKILL\u201d command along with the \u201cpkill\u201d command having the syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">pkill <span class=\"re5\">-SIGKILL<\/span> <span class=\"sy0\">&lt;<\/span>processName<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>In our case, to kill or terminate all the running processes of the Application \u201cfirefox\u201d, the \u201cpkill\u201d command will be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">pkill <span class=\"re5\">-SIGKILL<\/span> firefox<\/div><\/div>\n<p>This will terminate all the running processes of the Firefox Application forcefully:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"809\" height=\"133\" class=\"wp-image-23050\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-29.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-29.png 809w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-29-300x49.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-23021-29-768x126.png 768w\" sizes=\"auto, (max-width: 809px) 100vw, 809px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>Killing or Terminating a Process or processes of a specific Application in Ubuntu increases the Efficiency and speed of the overall system. Killing a Process frees up Memory or CPU resources. To kill a process in Ubuntu, the \u201cSystem Monitor\u201d can be used through the GUI. Also, the \u201ckill\u201d command, the \u201ckillall\u201d command, and the \u201cpkill\u201d command are useful when terminating or killing specific or all processes from the Terminal in Ubuntu.<\/p>","protected":false},"excerpt":{"rendered":"<p>Kill a Process in Ubuntu using either the System Monitor from GUI, the \u201ckill\u201d, \u201ckillall\u201d, and the \u201cpkill\u201d command in the Terminal. <\/p>","protected":false},"author":110,"featured_media":23051,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-23021","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/23021","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=23021"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/23021\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/23051"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=23021"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=23021"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=23021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}