Let's say I want to kill teamviewer, and it's child processes:
check what is teamviewer and its children's PID:
$ pstree -Gap 31458 teamviewerd,31458 -f ├─{teamviewerd},31460 ├─{teamviewerd},31461 ├─{teamviewerd},31462 ├─{teamviewerd},31463 ├─{teamviewerd},31464 ├─{teamviewerd},31465 ├─{teamviewerd},31466 ├─{teamviewerd},31549 └─{teamviewerd},24892
run kill to the PID of parent, and put - sign in front of the PID, to signal the whole group killing:$ kill -TERM -31458
no more PID 31458, with the children processes
$ pstree -Gap 31458
No comments:
Post a Comment