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

Henry S. Thompson ht@inf.ed.ac.uk
Sat Mar 23 13:05:58 GMT 2024


J M via Cygwin writes:

> 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.

I note that on Cygwin:

  pgrep -f /bin/bash

finds some but not all of my running bash processes.

  pgrep -a bash

finds all of them.

I leave it to others to explain why /usr/bin/bash doesn't work.

I note that on (Debian) Linux the results of the above alternatives
_also_ differ, but that pgrep -f /usr/bin/bash and pgrep -f /bin/bash
both work and give the same results.

ht
-- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
                10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND
                           e-mail: ht@inf.ed.ac.uk
                      URL: https://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]


More information about the Cygwin mailing list