This works:
process = StartProcess[$SystemShell];
WriteLine[process, "top"];
Dynamic[ReadString[process, "Processes: "], UpdateInterval -> 1]
The reason you can't use Import
is probably because the top
process doesn't terminate. It's the same thing if you try to use ReadString
without a second argument, it won't return anything because it will be waiting for the process to terminate first.
Since top
will continuously fill the buffer we have to detect somehow when one table ends and a new begins. A new table begins with the word "Processes", so I used that.