Context: I'm getting the current Ruby process ID.
Process.pid #=> 95291
Process.ppid #=> 95201
Process.uid #=> 501
Process.gid #=> 20
Process.euid #=> 501
Process.egid #=> 20
Context: I'm getting the current Ruby process ID.
Process.pid #=> 95291
Process.ppid #=> 95201
Process.uid #=> 501
Process.gid #=> 20
Process.euid #=> 501
Process.egid #=> 20
整齐:
pid
:The是调用Process.pid
方法的进程的进程ID(PID).ppid
:父进程(生成当前进程的进程)的PID.例如,如果在bash ruby test.rb
的进程中运行PID. uid
:进程正在运行的用户的UNIX ID. euid
:进程正在运行的effective用户ID.EUID根据具有此UID的用户可以执行的操作来确定允许程序执行的操作.通常与uid
相同,但与sudo
等命令不同. gid
:运行程序的UNIX组ID.egid
:像euid
,但对团体来说.