Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question

1 Answer 1

up vote 10 down vote accepted

This should work:

ps h --ppid $PID -o pid
share|improve this answer
    
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 '11 at 13:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.