Skip to content

Instantly share code, notes, and snippets.

@stefanocudini
Created March 26, 2012 13:28
Show Gist options
  • Select an option

  • Save stefanocudini/2205046 to your computer and use it in GitHub Desktop.

Select an option

Save stefanocudini/2205046 to your computer and use it in GitHub Desktop.
top by php
<?
$p = popen('/usr/bin/top','r');
while(!feof($p))
{
$r = fgets($p);
if(strstr($r,'root'))//filter root process
{
passthru('clear');
echo $r;
}
flush();
}
pclose($p);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment