This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes kill -9 -1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "kill -9 -1" Watch "kill -9 -1" New topic
Author

kill -9 -1

Mike Shn
Ranch Hand

Joined: May 26, 2001
Posts: 149
Hello
I always use the command to kill the process
kill -9 pid(process ID) .
Today on my Red Hat 7.3 box accidently typed
kill -9 -1 .. The monitor start blinking and everything freezed.
My questions is : What is the purpose of these commands:
kill -9 -1
kill -9
Thanks
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
First, I'd caution against casually using "kill -9". This is the harshest form of "kill" and cannot be stopped. It's almost always better to try one of the other signals (typically using just "kill" rather than "kill -9") in the first instance, and only use SIGKILL (9) if you can't shut the errant process doen more cleanly (see "man kill" for more details).
Naturally, I don't want to try this on my system, but my guess is that the kill command parsed the -9 as the signal to send, then the following -1 as the process to kill. It may have stripped off the '-' and killed process 1. Process 1 is usually the "init" process which started all the other processes when the system booted up, and is a very bad thing to "kill".


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
Man page for kill sez
-1 All processes with pid larger than 1 will be signaled.
That includes just about everything. Wheee! Kerflump! Bzzzt!
If you did this as root, it'd kill the works (a bad thing). If you were a normal user, I think it would only kill the processes you owned. Still not a good thing, but would leave the system intact.
Try not to do that again
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: kill -9 -1
 
Similar Threads
How to stop java process on Linux server ?
Equivalent kill -n for process.destroy()
Doing some "cleanup" before closing a program, how?
Kill Statement
How to stop bash script runing on Solaris