如何在php中输出shell命令的输出?

问题描述:

我想将名为jnettop的命令的输出打印到html文件中。如何在php中输出shell命令的输出?

我对shell_exec()非常熟悉和排序。 但它不工作,因为我使用的命令没有像here描述的顶部bash模式。

最终目标是有一个我去的网站,我看到jnettop通常会在终端显示的信息。 Here是链接到jnettops维基页面。

您可以尝试使用输出参数peresent的passthru()exec()

那Im使用犯规命令具有像顶端

一个bash模式确保它具有:jnettop --display text