shell 进度条实现代码
网络编程
#!/bin/bash
COUNTER=0
_R=0
_C=`tput cols`
_PROCEC=`tput cols`
tput cup $_C $_R
printf "["
while [ $COUNTER -lt 100 ]
do
COUNTER=`expr $COUNTER + 1`
sleep 0.1
printf "=>"
_R=`expr $_R + 1`
_C=`expr $_C + 1`
tput cup $_PROCEC 101
printf "]%d%%" $COUNTER
tput cup $_C $_R
done
printf "n"
一个用了统计CPU 内存 硬盘 使用率的shell脚本
#!/bin/bash#ThisscriptisusefordescribleCPUHardMemeryUtilizationtotal=0idle=0system=0user=0nice=0mem=0vmexec=/usr/bin/vmstatwhichsar/dev/null2&1if[$?-ne0]thenver=`vmstat-V|awk'{printf$3}'`nice=0temp=`v
统计 cpu 内存 使用率的shell脚本代码
#!/bin/shclearwhile((10))doNET=$(netstat-anp|grep1000|grepEST|wc-l)PRC=$(psaux|grepthread1|grep-vgrep|grep-vSCREEN|awk'{print"CPU:"$3"%,MEM:"$4"%,RSS:"$6/1024"M,VSZ:"$5/1024"M,PID:"$2""}')tputsc;echo-
shell实现数字打印从100到200的数
#!/bin/bash#name:printnumberfrom100to200foriin$(seq100200)doecho$idone
编辑:一起学习网
标签:使用率,脚本,内存,用了,硬盘