htop has a great way to show CPU usage.It shows the activity (usage in %) of each cores, and each core gauge is divided into three parts :blue: low priority processesgreen: normal processesred: kernel processesI'm doing an htop-like in Bash (yep !) for my studies and I'd like to read these values from /proc (in preference), or otherwise from anywhere, commands for example.top is displaying the same informations (as text) when you press 1.Eventually this can be a solution to read data from top if I can programmatically press 1 on background-ed top...So: is there a simple way to get these informations?If it is too complicated, read the global usage of the cores can be sufficient (I mean, for example cpu0: 12%).EDIT: Just wrote this little command to get per-CPU usage, but without more details (so it doesn't answers perfectly my question, but if I can't find a solution I will use it):ps axo psr,pcpu | awk 'END {  for (E in a)    print E, a[E]    }{ a[$1] += $2 }'Btw, do you think it's reliable?
Programmatically get CPUs 'detailed' usage, like top/htop
bash;top;proc