Problem with pgrep and pkill
-f option to
pkill searches the whole command line, instead of the default first 15 characters.
This is useful for example with
chromium-browser that actually lists in
/usr/lib/chromium-browser/chromium-browser–too long for
pkill default to find.
pgrep -f chromimum
does not work with default settings.
Fix this problem
You can make this change persistent by adding these lines to
alias pgrep="pgrep -f" alias pkill="pkill -f"
Example of find/SIGTERM process by name
These examples are for Chromium
find running process by name
returns the PID (integer).
SIGTERM running process by name