Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to make the ps command display uid instead of user name

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to let the ps command display uid rather than the user name, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

When using the ps command, it is found that some users display the user name, and some users display the UID, such as the run-time webmaster of the nmon program, but the ps does not display the uid 500directly

Through man, it is found that an account with an 8-character user name can display the full user name, and an account with a 9-character user name shows UID.

Use the following command to solve the problem

Ps-o ruser=userForLongName-e-o pid,ppid,c,stime,tty,time,cmd

Note: "userForLongName" is entered casually, and Linux will automatically check the length of this string. If it is 15, all user names with less than 15 digits can be displayed normally.

Now run the ps command results

Thank you for reading this article carefully. I hope the article "how to make the ps command display uid instead of user name" shared by the editor is helpful to everyone. At the same time, I also hope you can support us and follow the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report