While I find the -f option to ps really useful, I miss the numerical UIDs in the output.
Using ps -Ao uid it's possible to display the numerical UIDs:
nlykkei@debian:/proc/1839/net$ ps -Af | head -n5
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 02:00 ? 00:00:09 /lib/systemd/systemd --system --deserialize 17
root 2 0 0 02:00 ? 00:00:00 [kthreadd]
root 3 2 0 02:00 ? 00:00:00 [rcu_gp]
root 4 2 0 02:00 ? 00:00:00 [rcu_par_gp]
nlykkei@debian:/proc/1839/net$ ps -Ao uid,user,pid,command | head -n5
UID USER PID COMMAND
0 root 1 /lib/systemd/systemd --system --deserialize 17
0 root 2 [kthreadd]
0 root 3 [rcu_gp]
0 root 4 [rcu_par_gp]
Is it possible to add the numerical UIDs to the output of ps -Af? I cannot use ps -Af -o uid, and I don't want to type all of the columns that the -f option provides manually?
pscommand's manual erroneously describes as BSD options. Actually, it's thatpscommand's own idiosyncratic option. https://unix.stackexchange.com/a/511530/5132 – JdeBP Jan 26 '20 at 16:20ntake precedence over-f, when displaying the output? I'm just wondering why it makes theUIDcolumn display numerically? Furthermore, isn't it wrong for the-foption to name the columnUID, when it displays usernames? There is a distinction between-o uidand-o user... – Shuzheng Jan 27 '20 at 18:27WCHANin the output on Debian 9? – Shuzheng Jan 27 '20 at 18:31