{"id":9132,"date":"2019-05-15T13:19:47","date_gmt":"2019-05-15T13:19:47","guid":{"rendered":"https:\/\/ittutorial.org\/?p=9132"},"modified":"2019-11-28T08:22:39","modified_gmt":"2019-11-28T08:22:39","slug":"kill-9-all-processes-belonging-to-any-user-in-linux","status":"publish","type":"post","link":"https:\/\/ittutorial.org\/kill-9-all-processes-belonging-to-any-user-in-linux\/","title":{"rendered":"Kill All Processes Belonging to Any User in Linux"},"content":{"rendered":"<p>Hi,<\/p>\n<p>Sometimes you need to kill all processes of any user in linux.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8357\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/04\/Oracle-Linux-7.6.png\" alt=\"\" width=\"308\" height=\"223\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/04\/Oracle-Linux-7.6.png 308w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/04\/Oracle-Linux-7.6-300x217.png 300w\" sizes=\"auto, (max-width: 308px) 100vw, 308px\" \/><\/p>\n<p><!--more--><\/p>\n\n<p>&nbsp;<\/p>\n<p>Normally you can kill any process from its PID like following.<\/p>\n<p>&nbsp;<\/p>\n<pre>[root@MehmetSalih ~]# ps -ef | grep OSWatcher.sh\r\nroot      4183     1  6 May02 ?        20:13:56 \/bin\/sh .\/OSWatcher.sh 10 504 gzip \/opt\/oracle\/oak\/oswbb\/archive\r\nroot     73811  4183 15 16:10 ?        00:00:00 \/bin\/sh .\/OSWatcher.sh 10 504 gzip \/opt\/oracle\/oak\/oswbb\/archive\r\nroot     73813 73811 13 16:10 ?        00:00:00 [OSWatcher.sh]\r\nroot     73816 92104  0 16:10 pts\/1    00:00:00 grep OSWatcher.sh\r\n[root@MehmetSalih ~]#\r\n[root@MehmetSalih ~]# <span style=\"color: #ff0000;\">kill -9 4183<\/span>\r\n-bash: kill: (4183) - No such process\r\n[root@MehmetSalih ~]#<\/pre>\n<p>&nbsp;<\/p>\n\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>But sometimes you need killing all processes of any user , then you can use following code.<\/p>\n<pre>[root@MehmetSalih ~]#\u00a0 <span style=\"color: #ff0000;\">kill -9 `ps -ef|grep oracle | awk '{print $2}'`<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p>I have used Oracle user in this example, you can change username according to your need.<\/p>\n<p>&nbsp;<\/p>\n<h4><span style=\"color: #ff0000;\">Dont&#8217;t forget that you will have killed ALL PROCESSES OF ANY USER, so Be careful before run it.<\/span><\/h4>\n<p>&nbsp;<\/p>\n<p>For example, You have stopped Oracle EBS with adstpall.sh, but you have still EBS Process belong to applmgr, You can kill all processes of applmgr user like following.<\/p>\n<p>&nbsp;<\/p>\n<pre>[root@MehmetSalih ~]#\u00a0 kill -9 `ps -ef|grep applmgr | awk '{print $2}'`\r\n\r\n\r\n\r\n<\/pre>\n<p>Or you can use following command.<\/p>\n<pre>[root@MehmetSalih ~]#\u00a0 pkill -u applmgr\r\n\r\n\r\n\r\n\r\n[root@MehmetSalih ~]#\u00a0 pkill -u oracle<\/pre>\n<p>&nbsp;<\/p>\n<h4><span style=\"color: #ff0000;\">Do you want to learn Linux System Administration for Beginners, then read the following articles.<\/span><\/h4>\n<p><a href=\"https:\/\/ittutorial.org\/linux-administration-tutorial-for-beginners\/\">https:\/\/ittutorial.org\/linux-administration-tutorial-for-beginners\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, Sometimes you need to kill all processes of any user in linux.<\/p>\n","protected":false},"author":1,"featured_media":8357,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11],"tags":[4342,2672,2473,4332,4338,4335,4339,4340,2671,4333,4337,4331,4341,4334,2674,2673,4343,2686,2620,4336],"class_list":["post-9132","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-linux","tag-a-guide-to-kill","tag-database-tutorial","tag-goldengate-tutorial","tag-how-do-i-kill-all-a-users-processes-using-their-uid","tag-how-to-kill-a-process-from-the-command-line","tag-how-to-kill-a-process-in-linux","tag-how-to-kill-all-processes-in-linux","tag-how-to-kill-processes-in-linux-using-kill","tag-it-tutorial","tag-kill-9","tag-kill-all-processes-belonging-to-a-user-with-pkill","tag-kill-all-processes-belonging-to-one-user","tag-killall-and-pkill","tag-linux-kill-9","tag-linux-tutorial","tag-oracle-tutorial","tag-pkill-and-killall-commands-to-terminate-a-process","tag-programming-language-tutorial","tag-sql-server-tutorial","tag-use-killall-and-kill-commands-to-stop-processes-on-linux"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/04\/Oracle-Linux-7.6.png","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/9132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/comments?post=9132"}],"version-history":[{"count":4,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/9132\/revisions"}],"predecessor-version":[{"id":13027,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/9132\/revisions\/13027"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media\/8357"}],"wp:attachment":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media?parent=9132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/categories?post=9132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/tags?post=9132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}