$ sed -e 's/ .*//' -e 's/\.//' -e 's/^0*//' /proc/loadavgShow the current load of the CPU as a percentage.
Read the load from /proc/loadavg and convert it using sed:
Strip everything after the first whitespace:
sed -e 's/ .*//'Delete the decimal point:
sed -e 's/\.//'Remove leading zeroes:
sed -e 's/^0*//' by David Winterbottom (codeinthehole.com)
from All commands http://ift.tt/1jemvYA
No comments:
Post a Comment