[sf-lug] ps aux or ps -e

Michael Paoli Michael.Paoli at cal.berkeley.edu
Fri Jul 4 22:15:47 PDT 2008

Quoting Kristian Erik Hermansen <kristian.hermansen at gmail.com>:

> You don't need to grep out 'grep' :-)  do more people utilize ps aux or ps
> -e?

Well, I think perhaps the question is which is better or more
appropriate, ... and the answer is "it depends". :-)

In short, there's the BSD and System V flavors of the ps command.
For most typical Linux distributions, both are rolled into a single
ps command, and the flavors are invoked depending respectively upon
whether or not first option starts without or with leading -
(hyphen/minus) character; Digital UNIX also used that type of

On other *nix platforms, one may not have both flavors available.  On
some platforms (e.g. Solaris) they have distinct pathnames,
respectively /usr/ucb/ps or /usr/bin/ps.

They each have their advantages and disadvantages ... I tend to flip
a lot between BSD and System V flavors of ps, as they each - at least
in most implementations, have some unique and useful capabilities
that the other lacks.  E.g.:

Want all the command arguments without truncation?  Use the BSD
flavor, toss in the w option 3 or more times (for most BSD flavors, 3
or more w's is "unlimited" - for some, each w extends the length a
fair bit per occurrence).  Most System V ps implementations don't have
an equivalent option, though some have a -x ("eXtended"?) option that
will do that.

Want all the PIDs of a particular user, and perhaps other than the
invoking euid?  System V flavor: ps -lfu user

Want environment information (possibly limited by security
restrictions, but if available)?  Use the BSD flavor with the e

Want %CPU?  BSD flavor with u option

... and on and on the distinctions go ... in many cases, each flavor
offering some useful capability that the other doesn't have.

More information about the sf-lug mailing list