Four ways to kill the specified process name in Linux

The processName indicates the name of the process you want to operate.

  • Method 1

1
pkill processName
  • Method 2

1
killall processName
  • Method 3

1
kill -9 $(ps -ef|grep processName|grep -v grep|awk '{print $2}')
  • Method 4

1
kill -9 $(pidof processName)

Four ways to kill the specified process name in Linux
https://www.hardyhu.cn/2022/02/08/Four-ways-to-kill-the-specified-process-name-in-Linux/
Author
John Doe
Posted on
February 8, 2022
Licensed under