You can browse the source of Gnu coreutils on Savannah (or clone the repository on your machine), and in particular look at the source and the changelog of the kill
utility. There is not and has never been such a feature.
do {
intmax_t n = (errno = 0, strtoimax (arg, &endp, 10));
…
if (errno == ERANGE || pid != n || arg == endp || *endp)
{
error (0, 0, _("%s: invalid process id"), arg);
status = EXIT_FAILURE;
}
…
} while ((arg = *++argv));
The manpage you link to is for the kill
command from the util-linux collection. As you can see from the date of the man page, this feature is very old. Many Linux systems ship the kill
command from GNU coreutils, or the one from the procps package, and most of the time you'll see your shell's builtin rather than the external command anyway. None of these allow you to pass a bare command name as an argument.
On a related note, in bash, ksh and zsh, you can pass any job specification as an argument to kill
. Job specifications start with a %
and can be followed by a job number or by a part of the name of the command of that job.
$ jobs
[3] + Running sleep 9999 &
[2] - Stopped vim foo
[1] Running xterm &
$ kill %sleep
[3] + Terminated sleep 9999 &
$ jobs
[2] + Stopped vim foo
[1] - Running xterm &
killall
does that. (It does something different on Solaris, and make *sure* you understand the difference!) – dmckee --- ex-moderator kitten Nov 28 '11 at 23:18kill
is specific to Linux, and the feature doesn't seem to have existed on classic BSD either (e.g. 4.4BSD). – Gilles 'SO- stop being evil' Nov 28 '11 at 23:19kill
to behave the same as thekill
on OS X. Thekill
in question does not. – kojiro Nov 28 '11 at 23:27