commit 2
This commit is contained in:
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Суммарная загрузка CPU в процентах 0-100 (mac + linux).
|
||||
case "$(uname)" in
|
||||
Darwin) cores=$(sysctl -n hw.ncpu) ;;
|
||||
*) cores=$(nproc) ;;
|
||||
esac
|
||||
ps -A -o %cpu | awk -v c="$cores" '{s+=$1} END {printf "%d", s/c}'
|
||||
Reference in New Issue
Block a user