In: Computer Science
How do you find the process ID of a specific process and kill the process? I am using python3 on a kali linux vm
What is Process?
How do you find the process ID of a specific process?
In Linus operating system, every process has a seperate
PID(Process ID) which is used to identify it.
We can identify the process id by using following command:
pidof: It is used to identify the processID.
Syntax: pidof python (It identifies process id that python is running)
ps aux | grep: We can use ps command in combination with grep to find process id.
ps aux | grep -i python
How do you kill the process?
We can use 'kill' command to kill the identified processid.
Syntax: Kill 3174.
kill
command produces a SIGTERM signal and sends to process. That
SIGTERM signal asks process to kill itself.
It is a safe approach whicha avoids killing of child processes and
unreleased memory.
kill - 9, it is used for instant killing purpose. It generates SIGTERM signal and that signal won't ask and kills immediately.