统计 cpu 内存 使用率的shell脚本代码

上传:cl59654 浏览: 16 推荐: 0 文件:PDF 大小:27.07KB 上传时间:2021-01-16 16:22:37 版权申诉
代码如下:#!/bin/shclearwhile ((1>0))do NET=$(netstat -anp | grep 1000 | grep EST | wc -l) PRC=$(ps aux | grep thread1 | grep -v grep | grep -v SCREEN | awk ‘{ print ” CPU: ” $3 “%, MEM: ” $4 “%, RSS: ” $6/1024 “M, VSZ: ” $5/1024 “M, PID: ” $2 “”}’) tput sc; echo -n -e “\b”; tput rc; echo “SRV: thread1
上传资源
用户评论