What does kill -- -0 do?
In UNIX/Linux world two dashes one after other mean end of options. For example if you want to search for string -n
with grep
you should use command like:
grep -- -n file
If you want to get only the line number in above case you should use
grep -l -- -n file
So the command kill -- -0
try to send signal to process with ID -0
(minus zero)
In this case it is used to denote that the -0
is not an option being passed in. If you were to do kill -0
it would think of -0
as an option not as the PID being passed in.
For example if you did ls -- -l
it will look for a file named -l
as opposed to just listing the directory in long form.