通常、psコマンドは主に「ps -ef」または「ps auxw」と「grep」を組み合わせて使用します。
しかし、それはいくぶん不正確であり、直接のpsプロセス番号ほど直接的ではありません。
では、psはいくつのプロセス番号を渡すことができますか?
実験は次のとおりです。
[root@localhost YLA]# ps 0x7FFFFFFF
PID TTY STAT TIME COMMAND
[root@localhost YLA]# ps 0x80000000
error: process ID out of range
Usage:
ps [options]
Try 'ps --help <simple|list|output|threads|misc|all>'
or 'ps --help <s|l|o|t|m|a>'
for additional help text.
For more details see ps(1).
テストの結論:
psが渡すことができるプロセス番号は32ビットであり、signed int型です。渡すことができる最大のプロセス番号は2 ^ 31です。