To specify columns, I can use ps
's -o
option:
ps -o pid,cmd
How can I tell ps
to output all of its available columns?
ps
To specify columns, I can use ps
's -o
option:
ps -o pid,cmd
How can I tell ps
to output all of its available columns?
Best Answer
ps
is a very system dependant command. So the answer will depend on the variant of Unix you're using.With the
ps
from procps-ng version 3.3.3 on Linux:(for some reason
thcount
appears in the list of known fields but is not accepted as argument to-o
.nlwp
is OK though).You'll get a lot of duplication since many of those fields are aliases for the same thing (or different ways to express it. For instance, you don't really need
start
once you've gotlstart
).For the column headers to display the field selector instead of the normal heading (to help you refine which column you do want):
The fields specified by POSIX are args, comm, etime, group, nice, pcpu, pgid, pid, ppid, rgroup, ruser, time, tty, user and vsz. So you can use
For a command that should works across all compliant systems.