Hi Expert,
I have a text file that contain the following data
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1397 0.0 0.0 0 0 ? S< Jul14 0:00 [aio/28]
john 1398 0.0 0.0 0 0 ? S< Jul14 0:00 [aio/29]
john 1399 0.0 0.0 0 0 ? S< Jul14 0:00 [aio/30]
ruby 7 0.0 0.0 0 0 ? S< Jul14 0:00 [watchdog/1]
root 8 0.0 0.0 0 0 ? S< Jul14 0:01 [migration/2]
jane 9 0.0 0.0 0 0 ? SN Jul14 0:00 [ksoftirqd/2]
john 10 0.0 0.0 0 0 ? S< Jul14 0:00 [watchdog/2]
root 11 0.0 0.0 0 0 ? S< Jul14 0:01 [migration/3]
Now, what I want is to list just user john and ruby with certain header, e.g:
USER PID %CPU %MEM TTY STAT TIME COMMAND
john 1398 0.0 0.0 0 0 ? S< Jul14 0:00 [aio/29]
john 1399 0.0 0.0 0 0 ? S< Jul14 0:00 [aio/30]
ruby 7 0.0 0.0 0 0 ? S< Jul14 0:00 [watchdog/1]
How do I do that? with awk?
Thank you Expert.