简体   繁体   中英

How can I visualize real-time Linux system information like the output of command top?

I want to implement a simple demo that can visualize real-time system load, my requirement is really simple, just to get the data of command top is enough.

But I'm not sure how to get the real-time data, should I grep the output or read from file system , could anyone provide some clues on how to get the real-time data ?

thkx!

Parsing the output from top is certainly enough to visualize realtime system load. For general realtime system information, you might want to take a look at the /proc virtual filesystem , which contains information exposed by the kernel. This is also in easily parsible tabular form.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM