This dates back to the somewhat tortuous history of Unix (Wikipedia has a simplified diagram, which is far from complete). In particular, for a while, there were two major currents: System V developed by AT&T, and BSD developed at the University of California, Berkeley. This was around the early 1980s, long before Linux (1991), let alone Ubuntu (2004). Often these two currents made different decisions, and even today you'll find the occasional reference to “System V” and “BSD” variants or features.
The ps
command dates back from one of the first releases of Unix (it wasn't in version 1, the earliest man page I can find online is from version 5 (p.94) in 1974). At the time, ps
just had a few options, for example ps a
would display all processes instead of just the user's, and ps x
would display processes with no terminal attached. You'll note that the options don't start with -
: at the time, the convention of using -
for options wasn't near-systematic like it is today, it was mostly a thing for commands that took file names as normal arguments.
Over time, the various strands of Unix extended ps
with many more options. The BSD variant chose to retain the original syntax, with no leading -
, and a
and x
still exist today. The System V variant chose to adopt the syntactic convention of -
for options, and used different letters (for example ps -e
to display all processes). Oracle (formerly Sun) Solaris is an example of a System V variant (Solaris also ships a separate ps
executable, in a directory which is not on the default PATH
, for applications written with BSD in mind).
At the time Linux came onto the scene, the people who used it would often have prior experience of one Unix variant or another. Linux sometimes did things the System V way, sometimes the BSD way, sometimes its own way, either based on technical considerations or based on the experience and tastes of whoever implemented the feature. Linux's ps
command started out with BSD-like options, e.g. ps ae
to display all processes and include environment variables in the listing. Over time (in the late 1990s, I don't remember exactly when), the authors of Linux's ps
added options for people who were used to System V. So today either ps ax
or ps -e
will list all processes under Linux, and there is even an environment variable (PS_PERSONALITY
) to make ps
behave more like various Unix old Unix variants, for the sake of old scripts and people with set habits.
People who used several Unix variants didn't like that they'd have to modify their programs and their habits when switching from one Unix variant to another. So there was an effort to standardize a subset of functionality. This led to the POSIX standard (led by the IEEE), which Ubuntu by and large follows. The first edition whose scope included the ps
command came out in 1992; this one isn't available online, but the 1997 edition is. For the ps
command, like in many other cases, POSIX adopted the System V way of doing things.
The ps
command's standard syntax is one that is compatible with both System V and POSIX. In addition, that syntax can be said to be standard because it uses -
to introduce options by default. Some options exist only in one of the two syntaxes; fortunately they can be mixed in the same call.
Generally speaking, “BSD” vs “System V” doesn't have any technical implication. It refers to history: “BSD” is whatever choice BSD made in the 1980s and thereabouts, “System V” is whatever choice AT&T and their partners (especially Sun) made. “POSIX” is whatever choice the IEEE standardization committee made.
ps
optargs is to stand at the edge of an abyss Man Was Not Meant to Know.