-3
root@he:/home/he# ps -ef|grep init
root         1     0  0 08:40 ?        00:00:02 /sbin/init
root      3557  3545  0 10:09 pts/0    00:00:00 grep --color=auto init

What are various columns representing here?

2
  • 3
    just to note, since by your rep I assume you're new: you've been downvoted into oblivion because this question shows zero research effort. you could probably find this just by Googling; my cursory search for "ps columns" showed an entire page of links that look promising. we're happy to help you, but we're not here to do your work for you.
    – strugee
    Feb 18, 2014 at 5:55
  • 2
    as a side note, you could better do that with pgrep.
    – strugee
    Feb 18, 2014 at 5:56

2 Answers 2

4

Your grep filters out the relevant part of the output of ps:

ps -ef | head ; ps -ef | fgrep init

should get you:

UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 Feb13 ?        00:00:01 /sbin/init

have a look at man ps for an explanation of the column contents.

1

Couldn't add a comment to Anthon's answer. so adding below. Perhaps adding a -1 param to head command would be most suited in all *x platforms

ps -ef | head -1; ps -ef | fgrep init
              ^^^
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .