How to forcefully kill a process in Windows and Linux

Table of Contents

Case #

You have an operating system process which is stuck in your Windows or Linux machine and it cannot be stopped from the Windows Task Manager or other Linux GUI tool.

Solution #

First obtain the process ID from either the Windows Task Manager or by running the Powershell command


Then use the above process ID (PID) in the following command, either in Windows CMD or Powershell

taskkill /f /pid [PID]

To forcefully kill an operating system process in Linux, run the following commands.

#Find the appname Process ID (PID)
pidof appname
#Use the PID in the below command
kill -9 pid

Powered by BetterDocs