在该命令的手册页中ps
,我们有以下选项
-U userlist Select by real user ID (RUID) or name. It selects the processes whose real user name or ID is in the userlist list. The real user ID identifies the user who created the process, see getuid(2). -u userlist Select by effective user ID (EUID) or name. This selects the processes whose effective user name or ID is in userlist. The effective user ID describes the user whose file access permissions are used by the process (see geteuid(2)). Identical to U and --user.
然而,当我尝试
ps --forest -eo pid,ppid,ruser,euser,cputime,%mem,stat,comm -u example_username -U example_username
我仍然得到ruser
与euser
不同的流程example_username
。
以下是一些示例:
1255 1 root root 00:00:00 0.0 Ss cron
1256 1 message+ message+ 00:00:02 0.0 Ss dbus-daemon
1261 1 gnome-r+ gnome-r+ 00:00:00 0.1 Ssl gnome-remote-de
1270 1 root root 00:00:00 0.0 Sl ecbd
1278 1 polkitd polkitd 00:00:01 0.0 Ssl polkitd
1281 1 nvidia-+ nvidia-+ 00:00:00 0.0 Ss nvidia-persiste
-u
和是什么类型的过滤器-U
?
PS:我怀疑这些过滤器从属于该-e
选项,即它们被该选项覆盖。这应该在手册页中明确说明,但我找不到有关它的任何信息...