#!/bin/bash
sleep_time=$1
top=$2
while true;do
printf "===========================================I/O TopN By Read Write=========================================\n"
printf "%-10s %-6s %-7s %-6s %-8s %-8s %-8s %-20s %s\n" "TIME" "UID" "PID" "kB_rd/s" "kB_wr/s" "kB_ccwr/s" "iodelay" "Command" "Dir"
pidstat -d |tail -n +3 | sort -nrk 4,5 | head -n $((top+1)) | awk 'NR==1{print; next} {print $1, $2, $3, $4,$5, $6, $7, $8}' | while read -r time uid pid rd wr ccwr iodelay command; do
work_dir=$(pwdx $pid 2>/dev/null | awk '{print $2}')
printf "%-10s %-5s %-8s %-8s %-8s %-7s %-7s %-20s %s\n" "$time" "$uid" "$pid" "$rd" "$wr" "$ccwr" "$iodelay" "$command" "$work_dir"
done
printf "==========================================================================================================\n"
printf "===========================================I/O TopN By iodelay============================================\n"
printf "%-10s %-6s %-7s %-6s %-8s %-8s %-8s %-20s %s\n" "TIME" "UID" "PID" "kB_rd/s" "kB_wr/s" "kB_ccwr/s" "iodelay" "Command" "Dir"
pidstat -d |tail -n +3 | sort -nrk 7 | head -n $((top+1)) | awk 'NR==1{print; next} {print $1, $2, $3, $4,$5, $6, $7, $8}' | while read -r time uid pid rd wr ccwr iodelay command; do
work_dir=$(pwdx $pid 2>/dev/null | awk '{print $2}')
printf "%-10s %-5s %-8s %-8s %-8s %-7s %-8s %-20s %s\n" "$time" "$uid" "$pid" "$rd" "$wr" "$ccwr" "$iodelay" "$command" "$work_dir"
done
printf "==========================================================================================================\n"
# 添加几行用于分隔输出
for i in {1..1}
do
echo
done
sleep $sleep_time
done

胖柯G
- 粉丝: 453
最新资源
- Base编码全家桶:CTF中多层级Base嵌套的自动化拆解工具.pdf
- ChaCha20流密码:CTF中Nonce重用导致的数据泄露复现.pdf
- Brainfuck代码混淆:从密文到可执行脚本的逆向全解.pdf
- CRC32碰撞实战:CTF中校验和伪装的数据篡改技巧.pdf
- DES弱密钥实战:如何暴力破解CTF中的古董加密系统?.pdf
- CRC16逆向:CTF中短数据校验和的暴力破解技巧.pdf
- GCM模式认证漏洞:CTF中密文篡改的认证标签绕过手法.pdf
- ECC椭圆曲线加密:CTF中弱曲线参数的密钥还原实战.pdf
- Fernet令牌解析:CTF中加密时间戳的伪造与绕过.pdf
- HMAC签名伪造:CTF中密钥重用的消息篡改实战案例.pdf
- HPKE混合加密实战:CTF中HTTP、3协议数据的嵌套解密方案.pdf
- GOST加密算法:CTF中苏联遗留密码的逆向工程实战.pdf
- HTML实体编码的深层利用:XSS绕过与CTFWeb题的关联.pdf
- JWT令牌篡改:CTF中弱签名算法的HS256到None攻击.pdf
- JSFuck与Jother混淆:前端CTF题的代码降维打击方案.pdf
- Kerckhoffs原则应用:CTF中已知算法未知密钥的快速破解.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


