@krzemian Sorry I didn't see this at the time! In case it's still relevant: the difference is probably coming from the
wc
process, which is listed in the output of ps
when you have them running in parallel in a pipeline, but not when you just dump the ps
output to a file and run wc
on it later. I added a note about that to the answer.