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
-Pmean in the context of thepscommand?
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
-Ptheoretically does not exist because is not documented, Why an error was not thrown? - What does
PSRmean?
-Pis missing. gitlab.com/procps-ng/procps/-/blob/newlib/ps/help.c#L214PSR (SunOS), interesting, because in my case is inUbuntu.