0

"ps aux" outputs the following as the first line:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND

how can I preserve this line if I do a "ps aux | grep <someuser>" so that I can still see the header for each column?

In essence, I want to grep all but the first line of the initial "ps aux" output.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by thekashyap
0

ok, I answered my own question. haha

ps aux | egrep '<someuser>|USER'

I had to use egrep and single quote the string with the OR (|)

0

ps supports and option "h" (not -h) that suppresses the header from getting printed.
See "OUTPUT FORMAT CONTROL" section in "man ps".

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.