They do not.
So strictly speaking a question asking why they do is unanswerable, it taking a falsehood as its premise.
They show the
cmd and the
ucmd columns, two different pieces of information. Unfortunately, both the GNU
ps program and the FreeBSD
ps program make things quite confusing here.
Kernels such as Linux and the kernels of the BSDs provide four (relevant) pieces of information about a process, via files in
- its program image short name, a.k.a. the short name used for process accounting;
- its argument strings, initialized by
execve() and modifiable at runtime;
- its environment strings, initialized by
execve() and modifiable at runtime; and
- the full pathname of its executable program image file.
The argument strings and environment strings are modifiable at runtime in ways that I covered in https://unix.stackexchange.com/a/438007/5132 and https://unix.stackexchange.com/a/432681/5132 . Linux also permits modifying the process accounting name.
GNU Screen has modified its argument strings, so that the first one reads "SCREEN", but not its process accounting name, which remains as "screen".
There are just two columns for displaying these four pieces of information in
ps. In the FreeBSD
ps, the columns comprise this information as follows:
- The column named by
args comprises the argument strings, plus the environment strings if the
e option is used, plus the accounting name in square brackets if it does not match the first of the argument strings; all prefixed with a tree diagram if the
d option is used and it is the last column.
- The column named by
comm comprises the process accounting name.
cmd as an alias for the former and
ucmd as an alias for the latter. It puts the tree diagram and environment strings in both columns, and always puts the tree diagram in even if the column is not the last column.
-f option (not to be confused with the
f option) in the
-Af in the question is simply a shorthand for specifying a different set of columns for
ps to print. The default set of columns includes
ucmd. The set used when the
-f option is used includes
The manual for BSD
ps lays this out explicitly, giving the exact columns selected by its
-v shorthands. The manual for GNU
ps mentions "full format", "jobs format", "long format", and "user format" but does not explicitly list which set of columns each one is.
To further the confusion, both the GNU
ps and the FreeBSD
ps do not use the column names used on the command line, in the column headings given in their outputs. So one often cannot tell from the column heading alone which column is actually being displayed.
ps labels the accounting name column either
COMMAND, but also labels the argument strings column
ps labels the argument strings column either
COMMAND, but also labels the accounting name column either
s6-ps, for comparison, has just
env, with fixed and distinct header labels
ENVIRONMENT, giving just the first three of the four pieces of information from the kernel directly, without combining them.)
- Laurent Bercot (2014).
s6-ps. s6-linux-utils. Software.