Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm on Debian GNU/Linux. The man page for "kill" says I can use negative PID value to kill process group, but when running on command line, it does not work:

$ /bin/kill -9 -21581
/bin/kill: invalid option -- '2'

Usage:
 kill [options] <pid> [...]
etc.

When using the bash built-in kill, it works fine.

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

Because its the first PID, you need to preceed it with "--" otherwise it'll be mistook for an option.

kill -9 -- -21581
share|improve this answer
    
Is this documented anywhere? –  mehturt May 17 '12 at 14:46
    
Sorry. I found it documented on RHEL, but not on Debian. –  mehturt May 17 '12 at 14:54
    
@mehturt This is documented in the 'Common Options' chapter of the gnu coreutils doc [gnu.org/software/coreutils/manual/… –  Dana the Sane Nov 13 '12 at 17:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.