On 2019.08.22 12:31, Laurence Perkins wrote:


On Thu, 2019-08-22 at 10:03 +1000, Adam Carter wrote:
> On Thu, Aug 22, 2019 at 5:48 AM james <gar...@verizon.net> wrote:
> > On 8/16/19 12:44 PM, Jack wrote:
> > > ps auxf | grep systemd
> >
> > This is new turf for me. Upon issuing this command string I get::
> >
> > # ps auxf | grep systemd
> > root     24947  0.0  0.0  13964   996 pts/6    S+   15:43   0:00
> >           |   |   |           \_ grep --colour=auto systemd
> >
>
> This is showing that the only process with systemd in its name is the
> grep command itself; you could pass anything to grep and it will be
> found in the process list, eg;
>
> $ ps auxf | grep blah
> adam       52359  0.0  0.0   7708   940 pts/3    S+   09:55   0:00
>    \_ grep --colour=auto blah
>
> So, there's no systemd process running on this system.

A common tactic is to use grep twice:
ps auxf | grep -v grep | grep blah

That strips out all instances of grep from the results.
Putting what you're searching for first is more efficient, but putting
it last keeps the colorized output intact.

LMP
I often deal with that by using the search function in my terminal (usually konsole) to highlight the term I'm actually looking for.



Reply via email to