zoukankan      html  css  js  c++  java
  • What is the difference between Kill and Kill -9 command in Unix?

    w

    difference kill -9 pid and kill pid command - Ask Ubuntu  https://askubuntu.com/questions/791841/difference-kill-9-pid-and-kill-pid-command

    kill pid (which sends signal 15 (SIGTERM)) tells pid to terminate, but said program can execute some code first or even ignore the signal. kill -9 pid, on the other hand, forces the program to immediately terminate (it cannot be ignored).

    You should always try kill pid first, as it allows the program to do things like saving/closing open files before exiting. Only use kill -9 when you need the program to close and it won't respond to a simple kill pid.

     https://www.quora.com/What-is-the-difference-between-Kill-and-Kill-9-command-in-Unix

    kill  is used to send signal to a process. The default signal is TERM i.e. to terminate(kill) the process. Similar to End Task on windows task manager.

    To terminate(kill) any ordinary process :

    1. kill <pid>

    For a highly critical process, which kill alone cannot terminate :

    1. kill -9 <pid>

    where 99 is the strongest signal

     

    https://en.wikipedia.org/wiki/Unix_signal#List_of_signals

    SIGKILL 9 Terminate Kill (cannot be caught or ignored).

  • 相关阅读:
    POJ 2486
    奇怪的电梯
    穿越泥地(mud)
    救援行动(save)
    As Fast As Possible
    Connecting Universities
    They Are Everywhere
    Cells Not Under Attack
    吃饭
    花店橱窗(flower)
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6832086.html
Copyright © 2011-2022 走看看