Skip to content

Instantly share code, notes, and snippets.

@ralexrdz
Created April 15, 2023 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralexrdz/8ef61ca93f757f293f2331dc7825858e to your computer and use it in GitHub Desktop.
Save ralexrdz/8ef61ca93f757f293f2331dc7825858e to your computer and use it in GitHub Desktop.

check CPU

top -bn1 | grep load | awk '{printf "CPU Load: %.2f\n", $(NF-2)}'

check memory

free -m | awk 'NR==2{printf "Memory Usage: %s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment