常用:
    1)关闭某个进程。如kill 123
    2)强制关闭:如kill -9 123
    3)按命令行关闭:kill abc.sh
    4)加载配置不重启服务:kill -HUP nginx
    5)处理完当前任务加载配置重启服务:kill -USR1

    实际是发送某个signal给进程,默认是TERM结束信号。

    manul:

    1. KILL(1) User Commands KILL(1)
    2. NAME
    3. kill - terminate a process
    4. SYNOPSIS
    5. kill [-s signal|-p] [-q sigval] [-a] [--] pid...
    6. kill -l [signal]
    7. DESCRIPTION
    8. The command kill sends the specified signal to the specified process or process group. If no signal is specified, the TERM signal is sent. The TERM signal will kill processes which
    9. do not catch this signal. For other processes, it may be necessary to use the KILL (9) signal, since this signal cannot be caught.
    10. Most modern shells have a builtin kill function, with a usage rather similar to that of the command described here. The '-a' and '-p' options, and the possibility to specify pro
    11. cesses by command name are a local extension.
    12. If sig is 0, then no signal is sent, but error checking is still performed.
    13. OPTIONS
    14. pid... Specify the list of processes that kill should signal. Each pid can be one of five things:
    15. n where n is larger than 0. The process with pid n will be signaled.
    16. 0 All processes in the current process group are signaled.
    17. -1 All processes with pid larger than 1 will be signaled.
    18. -n where n is larger than 1. All processes in process group n are signaled. When an argument of the form '-n' is given, and it is meant to denote a process group, either
    19. the signal must be specified first, or the argument must be preceded by a '--' option, otherwise it will be taken as the signal to send.
    20. commandname
    21. All processes invoked using that name will be signaled.
    22. -s, --signal signal
    23. Specify the signal to send. The signal may be given as a signal name or number.
    24. -l, --list [signal]
    25. Print a list of signal names, or convert signal given as argument to a name. The signals are found in /usr/include/linux/signal.h
    26. -L, --table
    27. Similar to -l, but will print signal names and their corresponding numbers.
    28. -a, --all
    29. Do not restrict the commandname-to-pid conversion to processes with the same uid as the present process.
    30. -p, --pid
    31. Specify that kill should only print the process id (pid) of the named processes, and not send any signals.
    32. -q, --queue sigval
    33. Use sigqueue(2) rather than kill(2) and the sigval argument is used to specify an integer to be sent with the signal. If the receiving process has installed a handler for
    34. this signal using the SA_SIGINFO flag to sigaction(2), then it can obtain this data via the si_value field of the siginfo_t structure.
    35. NOTES
    36. It is not possible to send a signal to explicitly selected thread in a multithreaded process by kill(2) syscall. If kill(2) is used to send a signal to a thread group, then kernel
    37. selects arbitrary member of the thread group that has not blocked the signal. For more details see clone(2) CLONE_THREAD description.
    38. The command kill(1) as well as syscall kill(2) accepts TID (thread ID, see gettid(2)) as argument. In this case the kill behavior is not changed and the signal is also delivered to
    39. the thread group rather than to the specified thread.
    40. SEE ALSO
    41. bash(1), tcsh(1), kill(2), sigvec(2), signal(7)
    42. AUTHOR
    43. Taken from BSD 4.4. The ability to translate process names to process ids was added by Salvatore Valente svalente@mit.edu⟩.
    44. AVAILABILITY
    45. The kill command is part of the util-linux package and is available from Linux Kernel Archive ftp://ftp.kernel.org/pub/linux/utils/util-linux/⟩.
    46. util-linux March 2013 KILL(1)
    47. Manual page kill(1) line 27/73 (END) (press h for help or q to