1 |
On 22 August 2019 22:08:41 GMT-04:00, Andrew Udvare <audvare@×××××.com> wrote: |
2 |
> |
3 |
>> On 2019-08-22, at 12:31, Laurence Perkins <lperkins@×××××××.net> |
4 |
>wrote: |
5 |
>> |
6 |
>> A common tactic is to use grep twice: |
7 |
>> ps auxf | grep -v grep | grep blah |
8 |
> |
9 |
>Or grep with brackets: |
10 |
> |
11 |
>ps aux | grep '[f]irefox' |
12 |
> |
13 |
>I have a function for this: |
14 |
> |
15 |
>psgrep() { |
16 |
> ps aux | grep "[${1:0:1}]${1:1}"; |
17 |
>} |
18 |
> |
19 |
>This works because the ps output will have "grep [f]irefox" and the |
20 |
>regex can't match that line (without escaping the [] again). |
21 |
|
22 |
Or just use pgrep, I usually use pgrep - fa. |
23 |
-- |
24 |
Sent from my Android device with K-9 Mail. Please excuse my brevity. |