I see there is a difference in output between ps ef
and ps -ef
. What is that difference, are both commands correct or which is preferred?
I see there is a difference in output between ps ef
and ps -ef
. What is that difference, are both commands correct or which is preferred?
man ps
says:So,
ef
uses the BSDe
andf
options, and-ef
uses the Unix-e
and-f
options. These are different (sectionsSIMPLE PROCESS SELECTION
,OUTPUT FORMAT CONTROL
andOUTPUT MODIFIERS
respectively):Clearly, you're not selecting all processes using the
ef
options, but are using the default listing of processes, plus some additional formatting:Which should you use? What do you want to do with the output?
Also, see the
EXAMPLES
section (which does list-ef
rather prominently, and doesn't use the BSDe
option at all):See
man ps
(the one on your system, on-line can have different explanations).So the 1st method (
ps ef
) is BSD style and the manual page goes on withSo both are valid commands but they are not showing the same information.