1 2 3 4 5 6 7
#!/bin/sh # Display CPU usage percentage grep 'cpu ' /proc/stat | awk '{ usage=($2+$4)*100/($2+$4+$5) printf "CPU %.0f%%", usage }'