Home > System Tutorial > LINUX > body text

How to fix ps command showing UID instead of username

WBOY
Release: 2024-01-13 16:45:15
forward
724 people have browsed it

How to fix ps command showing UID instead of username

How to fix ps command showing UID instead of username

How to fix ps command showing UID instead of username

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

Found through man: Accounts with 8-digit usernames can display the complete username, and accounts with 9-digit usernames display UID

Use the following commands to solve;

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

Note: "userForLongName" is filled in casually, Linux will automatically check the length of this string, which is 15, then user names with less than 15 characters can be displayed normally

Now run the ps command result;

How to fix ps command showing UID instead of username

The above is the detailed content of How to fix ps command showing UID instead of username. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template