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?

blueFast
  • 4,200
  • 13
  • 37
  • 54

2 Answers2

3

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

WhiteWind
  • 251
  • 1
  • 3
2

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.

telcoM
  • 4,448
  • 15
  • 25