22智能在线
新记
linux ps查看进程显示的是用户ID而不是用户名是怎么回事?
用ps -ef | grep XXX 查看进程时候,第一列是UID,一般是显示用户名,但是我创建的用户显示的是 用户的id,是个数字,这是怎么回事?怎么配置
举报该文章
相关建议 2014-06-27
ps命令UID列默认只能显示8位(含8位)的用户名,超过8位就显示UID
但是ps可以自定义显示列的宽度,试一下:
ps -o ruser=useruser10 -e -o pid,ppid,c,stime,tty,time,cmd
UID列名被改为useruser10,这样就能显示10位的用户名了
温馨提示:内容为网友见解,仅供参考
当前网址:
https://22.t2y.org/zz/cssfxi2x2xsh220cixs.html
其他看法
第1个回答 推荐于2017-11-26
man ps可以看到NOTES里有
If the length of the username is greater than the length of the display column, the numeric user ID is displayed instead.
你的用户名长度超过8个字符了
要配置,就定制你的输出格式了,man ps都有详细解释
要学会用man本回答被提问者采纳
相似回答
大家正在搜
相关问题
为什么任务管理器中的进程有些显示的不是自己的用户名
Linux中,如何使用ps只显示进程名那个字符串,而不显示P...
linux ps查看进程显示的是用户ID,不是用户名是怎么回...
打开任务管理器看到很多进程的用户都是Owner而不是我的用户...
任务管理器进程里显示的都是用户名如:Administrato...
Linux使用useradd新建用户为什么指定了用户组,但i...
linux ps查看进程显示的是用户ID而不是用户名是怎么回...
为什么我的进程里用户名是uesr而不是administrat...