I run ps aux | grep somethinghere
.
The output shows the grep somethinghere
as a running process.
My question is, shouldn't ps aux
finish first, then grep somethinghere
run on its output? Maybe there is no need for ps
to finish (there is a pipe between them), but it should run as the first process, while grep
isn't running.
The output means that grep
is ran before ps
!
How is this? Shouldn't ps
run first, because its output should be piped to grep
?
Even if they are ran at the same time, why is that I always see grep
in output? Shouldn't I not see grep
sometimes, too?