I was trying to execute this command
echo exec("top");
and
echo exec("/usr/bin/top");
neither works (returns blank output)
does anybody know why?
Because top is an interactive program that is meant to be run on a terminal, not be executed from a script. You are probably want to run the 'ps' command with arguments which will sort output by cpu utilization. http://www.devdaily.com/linux/unix-linux-process-memory-sort-ps-command-cpu
2.1m questions
2.1m answers
60 comments
57.0k users