Help with use of pgrep or pkill commands with full name options

Brian Inglis Brian.Inglis@SystematicSW.ab.ca
Fri Mar 22 16:22:50 GMT 2024


On 2024-03-22 09:56, J M via Cygwin wrote:
> Help with use of pgrep or pkill commands with full name options.
> 
> I trying to use pgrep or pkill utility commands to find processes but using
> the full path names, by example, find /usr/bin/bash (package procps-ng):
> 
> Then, if I use pgrep -f /usr/bin/bash, don't find nothing.
> 
> Using pkill -f /usr/bin/bash don't get the task.
> 
> If I use pidof /usr/bin/bash, this works.
> 
> How do I get it to do use pgrep, pkill, etc?

Look at the proc names using `procps -ae` - if it does not show a path, do not 
use `-f, --fullname /path/name`, just use `name`, and you may have to experiment 
if you want to use `-x, --exact`, and possibly other options.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry



More information about the Cygwin mailing list