Redex Redex - 5 months ago 16
Linux Question

How does pkill mask work?

If I have process named

raspivid
and process named
raspivideo
running and I execute command
pkill raspvid
, does it kill both processes or only process which is named raspvid?

If pkill kills both processes is there any linux-command to do the perfect match?

Answer

pkill kills all processes that command pgrep lists with the same parameters. In your case it sends SIGTERM signal to both processes. The following command kills the exactly matching pattern only:

 pkill -x raspivid