ps命令支持的最大的进程号是多少

平时使用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可以传入的进程号是32bit的,也就是一个有符号的int型。能传入的最大的进程号是2^31。

原文地址:https://www.cnblogs.com/bugutian/p/12713003.html