4

If is executed ps -p 3384 3395 (observe -p is lowercase) then the output is as follows:

  PID TTY      STAT   TIME COMMAND
 3384 tty6     S+     0:00 man ls
 3395 tty6     S+     0:00 pager

Until here all fine and is expected.

Just by mistake was executed ps -P 3384 3395 (observe -P is uppercase) then the output is as follows:

 PID PSR TTY      STAT   TIME COMMAND
 3384   2 tty6     S+     0:00 man ls
 3395   3 tty6     S+     0:00 pager

Observe in this output appears a new header - it is PSR

Question

  • What does -P mean in the context of the ps command?

And yes, I already read both man ps and ps --help all where appears the documentation for the -p option/parameter as follows respectively:

  # Approach 1
   p pidlist
     Select by process ID. Identical to -p and --pid.

  -p pidlist
     Select by PID. This selects the processes whose process ID numbers appear in pidlist.  
     Identical to p and --pid.

  # Approach 2
  -p, p, --pid <PID> process id
        --ppid <PID> parent process id

But about -P does not appear nothing. To be honest when the ps command was executed with -P - theoretically I expected an error because -P does not exist, it because -P is not documented.

Extra Questions

  • If -P theoretically does not exist because is not documented, Why an error was not thrown?
  • What does PSR mean?
3

2 Answers 2

2

I don't have any knowledge of why -P is not documented. I wonder if the feature was not fully supported at some point in the past?

-P (or -o psr) sets the output to include PSR, which the manual states is:

       psr         PSR       processor that process is currently assigned to.

There is a comment in the help code for ps that suggests -P is "missing" from the help. Going back to the initial checkin that I can find, several other flags used to be so marked (including -c, -L, and -M). This is the only of the "dash" options I see still listed as missing from the help page.

2

It indicates which processor is currently being used to execute the process. Even though the -P option is not documented, PSR is described under STANDARD FORMAT SPECIFIERS in the manpage for ps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.