平时使用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。

posted on 2020-04-16 15:05  步孤天  阅读(692)  评论(0编辑  收藏  举报