Saturday, April 20, 2024
71
rated 0 times [  71] [ 0]  / answers: 1 / hits: 2213  / 1 Year ago, sun, january 1, 2023, 1:17:44

The following command signs me out (do not run this command):



kill -9 -1


I don't understand why.



Can someone explain this to me?


More From » command-line

 Answers
5

The syntax is kill SIGNAL PID.



The -9 option specifies that the SIGKILL signal should be sent (immediately terminate the target process(es), and specifying the PID -1 is shorthand for "all processes except itself and init".



Since you don't use sudo (and presumably don't have root permissions), this immediately kills all processes you have permission to kill - your entire session, hence logging you out.


[#35576] Sunday, January 1, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oraoming

Total Points: 354
Total Questions: 105
Total Answers: 124

Location: Iraq
Member since Sat, Apr 3, 2021
3 Years ago
oraoming questions
Fri, Aug 20, 21, 10:08, 3 Years ago
Mon, May 24, 21, 21:56, 3 Years ago
Mon, Dec 12, 22, 23:21, 1 Year ago
Mon, Sep 12, 22, 11:38, 2 Years ago
;