0

This is strange:

» ps -ef | grep gitlab
gitlab-+ 19663  4237  0 06:45 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle

But the gitlab-+ user does not exist:

» cat /etc/passwd | grep gitlab
gitlab-www:x:998:997::/var/opt/gitlab/nginx:/bin/false
git:x:997:996::/var/opt/gitlab:/bin/sh
gitlab-redis:x:996:995::/var/opt/gitlab/redis:/bin/false
gitlab-psql:x:995:994::/var/opt/gitlab/postgresql:/bin/sh
gitlab-prometheus:x:994:993::/var/opt/gitlab/prometheus:/bin/sh

Why could that be?

How can I tell ps to show me the user id instead of the user name, for all entries?

2

Use n parameter, described in manual page:

n      Numeric output for WCHAN and USER (including all types of UID and GID)

e.g

ps -ef n

N.B. there should be space, not dash before n

1

The + sign at the end of the UID field just means "the username is longer than 8 characters and did not fit here".

For historical reasons, the field widths of ps -ef output have been kept as they are, even when usernames longer than 8 characters have become common: mostly because there are a lot of scripts that parse its output and would fail in mysterious ways if the field widths would change.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.