Linux command
kill 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Terminate
kill [process_id]
List
kill -l
Example
kill %[job_id]
Example
kill -HUP [process_id]
Example
kill -INT [process_id]
Force kill
kill -9 [process_id]
Pause
kill -STOP [process_id]
Example
kill -SIGUSR1 -[group_id]
说明
kill sends a signal to a process, usually to stop it. All signals except SIGKILL and SIGSTOP can be intercepted by the process to perform a clean exit. By default, SIGTERM is sent.
参数
- -l, --list
- List signal names, or convert signal number to name
- -L, --table
- List signal names and numbers in a table
- -s signal
- Specify signal to send
- -signal
- Specify signal by name or number (e.g., -9, -KILL, -SIGKILL)
- -p, --pid
- Print the process ID only; do not send a signal
- -q, --queue value
- Send the signal using sigqueue(3) with the accompanying integer value
- pid
- Process ID to signal. A PID of 0 signals all processes in the current process group. A PID of -1 signals all processes with PID > 1.
- %job_id
- Job ID from shell job control
FAQ
What is the kill command used for?
kill sends a signal to a process, usually to stop it. All signals except SIGKILL and SIGSTOP can be intercepted by the process to perform a clean exit. By default, SIGTERM is sent.
How do I run a basic kill example?
Run `kill [process_id]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -l, --list do in kill?
List signal names, or convert signal number to name