如何在php中打印shell命令的输出


How to print the output of a shell command in php?

我想将名为jnettop的命令的输出打印到一个html文件中。

我对shell_exec()和排序非常熟悉。但它不起作用,因为我使用的命令没有像这里描述的top那样的bash模式。

最终目标是有一个我可以访问的网站,我可以看到jnettop通常会在终端中显示的信息。这是jnettops wiki页面的链接。

您可以尝试passthru()或exec()和peresent输出参数。

我使用的命令没有像top 那样的bash模式

当然有:jnettop --display text