ps -eaf
..
Run Code Online (Sandbox Code Playgroud)kude 22593 12078 0 09:06 ? 00:00:02 smbd -D hasi 22929 12078 0 09:12 ? 00:00:00 someprog.pl root 22950 43 0 Sep08 ? 00:00:19 [nfsiod] root 24558 43 0 Sep09 ? 00:00:28 [pdflush] root 25320 1 0 00:00 ? 00:00:01 /usr/bin/atop -a -w /var/log/atop/atop_20110916 600 1466 25757 12078 0 10:12 ? 00:00:00 smbd -D root 26752 12078 0 10:32 ? 00:00:01 smbd -D
..
id username2
uid = 1466(username2)gid = 513(DomainUsers)groups = 513(DomainUsers)
LDAP中的所有用户(/etc/nsswitch.conf都是正确的,一切都正确 - 但只有这个用户不显示)
为什么显示uid号码(1466)而不是用户名?
ano*_*ard 11
正如Ray Toal所提到的,它仅限于8个字符的限制.这不是一个bug,而是Ray提到的标准的一部分.如果你查看ps(部分procps包装)的源代码,其中一条评论说
The Open Group Base Specifications Issue 6 (IEEE Std 1003.1, 2004 Edition)
requires that user and group names print as decimal numbers if there is
not enough room in the column, so tough luck if you don't like it.
The UNIX and POSIX way to change column width is to rename it:
ps -o pid,user=CumbersomeUserNames -o comm
The easy way is to directly specify the desired width:
ps -o pid,user:19,comm
Run Code Online (Sandbox Code Playgroud)
如果检查链接 的部分STDOUT它说,字段(用户,RUSER,组,R-基团,如果它能够获得和场宽度允许,或十进制表示以其他方式)将打印.
用户和组名称字段宽度限制为8的原因可能是遗留支持,但这只是猜测.
| 归档时间: |
|
| 查看次数: |
26599 次 |
| 最近记录: |