pgrep pkill fulltext process name search
Adding the -f option to pgrep and 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 ps as /usr/lib/chromium-browser/chromium-browser–too long for pgrep and pkill default to find.
pgrep -f chromiumworks, while
pgrep chromiumdoes not work with default settings.
Make this change persistent by adding these lines to ~/.bash_aliases
alias pgrep="pgrep -f"
alias pkill="pkill -f"Examples for Chromium:
- find running process by name:
pgrep chromiumreturns the PID (integer). - SIGTERM running process by name:
pkill chromium