Friday, 5 August 2016

What is the usage of -9 in kill command ?


There are many switches other than 9 and can be used with kill command.
  • SIGHUP (hangup)
    Tells the program that the user disconnected (e.g. SSH session or terminal window was closed)
    Usually does a graceful shutdown of the program.
  • SIGINT (interrupt)
    Sent when you hit CTRL+C
    Usually means "stop what you're doing" - may or may not kill the program
  • SIGTERM (terminate)
    The default sent by kill and killall.
    Usually terminates the program... sometimes after the program finishes whatever it's doing.
  • SIGSTOP (stop)
    Sent when you hit CTRL+Z
    Pauses the program, discussed above
  • SIGPIPE (pipe closed)
    Tells the program that the the pipeline has closed.
    Usually terminates the program.
    For example cat /etc/passwd | head -n1 will send SIGPIPE to the cat process after the first line is printed, causing cat to terminate before finishing the whole file.
     

No comments:

Post a Comment

Note: only a member of this blog may post a comment.