Linux killall command
Linux killall is used to kill a process; unlike kill, it kills all processes with a specified name.
The kill command kills a process by its PID and needs to be used together with ps, whereas killall operates directly on the process name, which is more convenient.
Syntax
killall [选项] name
Parameter Description:
- name : process name
The options include the following parameters:
- -e | --exact : the process name must match exactly
- -I | --ignore-case : ignore case
- -g | --process-group : terminate the process group
- -i | --interactive : ask before terminating
- -l | --list : list all signal names
- -q | --quite : output nothing if no process is terminated
- -r | --regexp : interpret the process name pattern as an extended regular expression.
- -s | --signal : send a specified signal
- -u | --user : terminate processes of a specified user
- -v | --verbose : display detailed execution
- -w | --wait : wait for all processes to terminate
- -V |--version : display version information
- --help: display help information
Example
# killall -9 php-fpm //结束所有的 php-fpm 进程
Linux Command Reference