进程

查看进程

pa
pstree

关闭进程(通过PID)

发送信号给指定的进程.如果没有指定信号.
如果没有指定信号,默认信息TERM.
The TERM signal will kill processes which do not catch this signal.

现在很多程序都在内部自建了关闭功能.

SYNOPSIS
kill [-s signal|-p] [-q sigval] [-a] [—] pid…
kill -l [signal]

pid
Specify the list of processes that kill should signal. Each pid can be one of five things:

-s, —signal
指定信号,可以是数字,也可以用名字.
信号包括

  1. HUP 1 终端断线
  2. INT 2 中断(同 Ctrl + C
  3. QUIT 3 退出(同 Ctrl + \)
  4. TERM 15 终止
  5. KILL 9 强制终止
  6. CONT 18 继续(与STOP相反, fg/bg命令)
  7. STOP 19 暂停(同 Ctrl + Z

-l, —list [signal]

-L, —table

-a, —all
Do not restrict the commandname-to-pid conversion to processes with the same uid as the present process.
当处理当前进程时,不限制命令名和进程号的对应关系.

-p, —pid

-q, —queue sigval

关闭进程(通过name)

killall