1

According to the Mac man page for ps it says for the -u flag:

-u      Display the processes belonging to the specified usernames.

However, it seems to display different information rather than just being attached to usernames. E.g. here's the headers for ax:

PID   TT  STAT      TIME COMMAND

and here are the headers for aux:

USER              PID  %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND

Any idea why? Is the man page incorrect?

2

They're both sort of correct. There's a difference between ps u and ps -u. Consider:

$ ps -u blm
  UID   PID TTY           TIME CMD
  502  4278 ??         0:00.04 sshd: blm@ttys000
  ...

$ ps u blm
ps: illegal argument: blm
usage: ps [-AaCcEefhjlMmrSTvwXx] [-O fmt | -o fmt] [-G gid[,gid...]]
          [-u]
          [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]
       ps [-L]

Also:

$ ps aux
USER              PID  %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
root                1   1.9  0.1  2455856   4648   ??  Ss   Wed05PM   2:52.80 /
...

$ ps -aux
ps: No user named 'x'

The man page documents the options preceded by -, but ps (for compatibility with other Unix flavors) also takes options without a preceding -, with often completely different meanings.

In the manual page, go down to LEGACY DESCRIPTION for more information.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .