进程的pid,ppid,uid,euid,gid和egid有什么区别? [英] What is the difference between a Process' pid, ppid, uid, euid, gid and egid?

查看:670
本文介绍了进程的pid,ppid,uid,euid,gid和egid有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文:我正在获取当前的Ruby进程ID.

Process.pid  #=> 95291

Process.ppid #=> 95201

Process.uid  #=> 501

Process.gid  #=> 20

Process.euid #=> 501

Process.egid #=> 20

推荐答案

顺序:

  • pid:这是您在其中调用Process.pid方法的进程的进程ID(PID).
  • ppid:父进程(产生当前进程的进程)的PID.例如,如果在bash shell中运行ruby test.rb,则该进程中的PPID将是Bash的PID.
  • uid:进程正在其下运行的用户的UNIX ID.
  • euid:进程正在其下运行的有效用户ID. EUID根据允许使用此UID的用户的操作来确定允许执行的程序.通常与uid相同,但是对于诸如sudo的命令可以有所不同.
  • gid:程序在其下运行的UNIX组ID.
  • egid:类似于euid,但用于组.
  • pid: The is the process ID (PID) of the process you call the Process.pid method in.
  • ppid: The PID of the parent process (the process that spawned the current one). For example, if you run ruby test.rb in a bash shell, PPID in that process would be the PID of Bash.
  • uid: The UNIX ID of the user the process is running under.
  • euid: The effective user ID that the process is running under. The EUID determines what a program is allowed to do, based on what the user with this UID is allowed to do. Typically the same as uid, but can be different with commands like sudo.
  • gid: The UNIX group ID the program is running under.
  • egid: Like euid, but for groups.

这篇关于进程的pid,ppid,uid,euid,gid和egid有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆