Unix – Modern Equivalent of ‘ps aux’ on macOS Sierra

unix

The BSD backend of MacOS has ps built in. The BSD General Commands Manual says that

The biggest change is in the interpretation of the -u option, which now displays processes belonging to the specified username(s). Thus, "ps -aux" will fail (unless you want to know about user "x"). As a convenience, however, "ps aux" still works as it did in Tiger.

I am wondering what the current standard is for this—dare I write—obsolete command+parameter sequence.

Best Answer

To replicate ps aux (BSD style) in the AT&T version of ps, you have to use

ps -Ao user,pid,%cpu,%mem,vsz,rss,tt,stat,start,time,command

This command is compatible with scripts that expect the same output as ps aux.

The only difference is the sort order; ps aux sorts all processes by their start time whereas ps -Ao sorts them by PID.


ps -jef is a shorter command, but it will output different headers.:

  • USER
  • PID
  • PPID
  • PGID
  • SESS
  • JOBC
  • STAT
  • TT
  • TIME
  • COMMAND
  • UID
  • C
  • STIME
  • TTY