Bash get parent process pid

Get the parent id of a process using the ps command. Example:

$ my_child_id=41219
$ echo "parent id: $(ps -o ppid= ${my_child_id})"
parent id:   1
Did this help you? Please let me know with a comment. Thank you
Posted .

Comments (RSS)

Leave a comment