💻 Tech
To find a specific process and kill that process, you can use pgrep
and kill
pgrep
command below will find the process that contains the word npm
and show the command that started the process.
pgrep -a npm # output: 3759148 npm start
kill
command below will terminate the process with specified process ID forcefully because -9
signifies a SIGKILL
signal, which kills the process without giving it the chance to clean up the process. Without -9
, the kill
command will use the default signal SIGTERM
(-15
) which will terminate the process gracefully.
kill -9 3759148