7

What I need is, given a process id, list all his children without any clutter (table header, other columns than the pid)

What I have is :

ps h --ppid $PID

Which gives me:

26277 pts/13   S+     0:10 cmd1
26280 pts/13   S+     0:10 cmd2
...

Using h allow me to hide the table header.

Is there a way to tell ps to not print the pts/13 S+ 0:10 cmd part in order to get a list of children process ids separated by carriage return?

Thank you!

1 Answer 1

12

This should work:

ps h --ppid $PID -o pid
1
  • Thank you, it works :) I thought of using -o before, but in my tests ps threw me a syntax error. (I think I had concurrent switches when I tried it...).
    – katsuo11
    May 20, 2011 at 13:44

You must log in to answer this question.

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