Linux User 2db42127d0 update
2022-08-13 18:10:53 +00:00

6 lines
197 B
Bash

#!/bin/bash
usage=$(cat <(grep 'cpu ' /proc/stat) <(sleep 0.3 && grep 'cpu ' /proc/stat) | awk -v RS="" '{print ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}' | cut -d'.' -f1)"%"
echo "$usage"