So, this isn't a problem as such, just something I'm curious about. I'm using Linux Mint MATE which is branched off Debian. If I do:
ps afx | grep abcdefg
I get:
16599 pts/3 S+ 0:00 | \_ grep --color=auto abcdefg
So, it's showing the process for the grep. But, that's after the ps
in the pipe: I would have thought that the above does the ps
, gets the results, and then passes them to grep
. So how come the grep
is actually showing up in the ps
results? Doesn't it happen afterwards? I think I'm missing something fundamental about what the pipe actually does.