2016年12月5日 星期一

[Linux 常見問題] How to get child process from parent process


Source From Here
Question
Is it possible to get the child process id from parent process id in shell script?

How-To
You can leverage command pgrep. For example:
// List process tree
# ps auxf
...


// List process(s) with parent pid=3253
# pgrep -P 3253
3254
3545


// List process(s) with parent pid=3254
# pgrep -P 3254

// List process(s) with parent pid=3254
# pgrep -P 3545
3565
3712
3719
3736
 


沒有留言:

張貼留言

[ Python 常見問題 ] python generator “send” function purpose?

Source From  Here   Question   Can someone give me an example of why the "send" function associated with Python generator function...