Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Why grep in "ps aux |(head -n 1 ;grep [f]irefox)" can get lines to match? Commented Feb 15 at 5:32
  • Either it doesn't work, or it works coincidentally. Or maybe you just think it works but actually a bunch of stuff is thrown away at the start that you didn't know about. Basically, output of ps aux is longer so it fills head's buffer, and the result of your suggested command is unreliable at best. Commented Feb 15 at 5:34
  • quits throwing away all the rest of what it read. ? NO,absolutely not ,please see my latest update. Commented Feb 15 at 5:42
  • @showkey you’re missing the most important part of all this — when pipes are used, the result isn’t seekable; your head + sort test reads from a file (raw.txt), which is seekable. Commented Feb 15 at 8:27