Parsing output of “top” command (Shell) with PHP

前端 未结 2 1669
一向
一向 2021-01-21 11:11

I\'m trying to export the output of the \"top\" command (unix) with PHP. Invoking and reading the command/output is pretty simple using the \"exex\" function but the question is

2条回答
  •  无人及你
    2021-01-21 11:52

    As mentioned by Lucas, ps is probably printing what you would expect.

    If your Unix flavour is Linux, I think pidstat (from the sysstat package) is better suited for your needs (not to mention, documented in a clearer way, in my opinion).

提交回复
热议问题