블로그 이미지
.
속눈썹맨

공지사항

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Unix ps명령에서 ID대신 UID가 뜨는 이유

2005. 5. 20. 16:19 | Posted by 속눈썹맨
ID가 9글자 이상이면 ps에서 ID 대신 UID를 보여준다.

소스 : http://procps.sourceforge.net/
FreeBSD에서 ps 소스 보기 : /usr/src/bin/ps/

이유 설명
http://procps.sourceforge.net/faq.html
Why do long usernames get printed as numbers?

The UNIX and POSIX standards require that user names and group names be printed as decimal integers when there is not enough room in the column. Truncating the names, besides being a violation of the standard, would lead to confusion between names like MichelleRichards and MichelleRichardson. The UNIX and POSIX way to change column width is to rename the column:

     ps -o pid,user=CumbersomeUserNames -o comm
The easy way is to directly specify the desired width:
     ps -o pid,user:19,comm