Online Linux Terminal Logo
OnlineLinuxTerminal
系统与进程CLI Manual

$kill

Send termination or control signals to processes by PID.

命令语法POSIX Standard
kill [OPTIONS] PID...
Linux 社区2.4k 在线

与真实 Linux 用户交流,学习常用命令并免费获取精美速查表 PDF。

在交互式终端沙盒中实时运行

无需安装的客户端实时仿真环境。

在全屏终端工作区中打开 ↗
bash — terminal

概述与工作原理

`kill` transmits POSIX signals to running processes. Despite its name, `kill` is a signal dispatcher. By default, it sends `SIGTERM` (15), which politely asks a process to clean up resources and exit. If a program is completely frozen, `SIGKILL` (9) forcefully terminates it immediately.

常用参数与选项说明

Flag / OptionDescription
-9, -KILLSend SIGKILL to forcefully terminate a process immediately (cannot be caught or ignored).
-15, -TERMSend SIGTERM to request graceful termination (default signal).
-lList all available signal names and numbers.

实际生产案例与代码范例

#1Gracefully terminate process with PID 1024
kill 1024

Sends SIGTERM to allow graceful shutdown.

#2Force kill an unresponsive process
kill -9 1024

Immediately stops the process at the kernel level.