sry for not being familiar with question conventions since im new here.
i want to write a script that prints the full children's tree recursively of a given pid.
i got so far as:
ps h -ef | awk '$3='$input_pid' {print $2}' | sort -n
but this is just for printing the immediate children of the given pid (sorted).
the question is: how can i summon the recursive function for every child-pid of the given pid?
thanks...
попробуйте это
pstree -p parent_process_ID
Если вы хотите, чтобы отображался только pid
pgrep -P parent_process_ID
или более простой и подробный дисплей.
ps auxfww | grep -v grep | grep process_name