You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ServerBot/cpu.sh

9 lines
210 B

#!/bin/bash
function cpuUsage {
ps -A -o pcpu | tail -n+2 | paste -sd+ | bc | awk '{print int($1)}'
}
function cpuTop {
ps -eo pid,cmd,%cpu --sort=-%cpu | head -2 | tail -n 1 | sed 's: :%20:g; s:/:%2F:g'
}