Linux pkill Command

Linux 命令大全Linux Command Encyclopedia

Linux pkill is used to kill a process, unlikekillthe difference is that it kills all processes with the specified name, similar tokillallcommand.

The kill command kills the specified process PID and needs to be used with ps, while pkill directly operates on the process name, making it more convenient.

Syntax

  pkill [选项]  name

Parameter Description:

  • name: process name

The options include the following parameters:
  • -o Send the signal only to the smallest (starting) process ID found-n Send the signal only to the largest (ending) process ID found
  • -P Specify the parent process ID to send the signal
  • -g Specify the process group
  • -t Specify the terminal that started the process

Examples

# pkill -9  php-fpm          //结束所有的 php-fpm 进程

Linux 命令大全Linux Command Encyclopedia

Other Extensions