• kill 发送消息给进程命令


    功能:

    kill命令发送信号给进程。

    格式:

    kill [-s signal|-p] [-q sigval] [-a] [--] pid...
    kill -l [signal]

    kill [-s <信息名称或编号>][程序] 或 kill [-l <信息编号>]

    参数:

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

    n where n is larger than 0. The process with pid n will be sig‐
    naled.

    0 All processes in the current process group are signaled.

    -1 All processes with pid larger than 1 will be signaled.

    -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 the signal must be speci‐
    fied first, or the argument must be preceded by a '--' option,
    otherwise it will be taken as the signal to send.

    commandname
    All processes invoked using that name will be signaled.

    -s, --signal signal //信息名称
    Specify the signal to send. The signal may be given as a signal name or
    number.

    -l, --list [signal] //打印编号
    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

    -L, --table
    Similar to -l, but will print signal names and their corresponding num‐
    bers.

    -a, --all
    Do not restrict the commandname-to-pid conversion to processes with the
    same uid as the present process.

    -p, --pid
    Specify that kill should only print the process id (pid) of the named
    processes, and not send any signals.

    -q, --queue sigval
    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 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.

    实例:

    -l 编号

     1.2 发送SIGHUP信号,可以使用一下信号 

     1.3  彻底杀死进程

  • 相关阅读:
    【LeetCode-字符串】重构字符串
    【LeetCode-二叉树】填充每个节点的下一个右侧节点指针
    【LeetCode-回溯】分割回文串
    【LeetCode-字符串】最后一个单词的长度
    【LeetCode-数组】生命游戏
    【LeetCode-链表】奇偶链表
    【LeetCode-字符串】反转字符串
    【LeetCode-数学】打乱数组
    Java中实现多线程的3种方法介绍和比较
    oracle 临时表空间、数据表空间、创建用户名与密码、赋予用户权限
  • 原文地址:https://www.cnblogs.com/gaiting/p/12174703.html
Copyright © 2020-2023  润新知