Linux parent process and child process when 'sudo'

如果在一般用户下如user,执行sudo命令,会产生两个进程。

ps -ef | grep Container

root 4305 643 0 16:37 pts/39 00:00:00 sudo ./ContainerCompilation.sh
root 4306 4305 0 16:37 pts/39 00:00:00 /bin/bash ./ContainerCompilation.sh

4306进程的父进程是4305,也就是说unix先生成4305进程将命令交给root,然后产生4306子进程来执行

原文地址:https://www.cnblogs.com/codingforum/p/5835999.html