Created
August 4, 2022 15:24
-
-
Save Beaglefoot/4d8c48cd5aecbcba0f61524ad63d83cd to your computer and use it in GitHub Desktop.
avg_cpu_load
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat /proc/stat | awk ' $1 == "cpu" { idle_time = $5; for (i = 2; i <= 10; i++) total_time += $i } END { print 100 - 100 * (idle_time / total_time) } ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment