[root@ts-xxx-xxx-xxx ~]# ps aux | grep del | awk '{cpu+=$3; memory+=$4} END {print "Total CPU:", cpu, "Total Memory:", memory}'
Total CPU: 995.5 Total Memory: 0
[root@ts-xxx-xxx-xxx ~]# ps aux | grep lpdel | awk '{cpu+=$3; memory+=$4} END {print "Total CPU:", cpu, "Total Memory:", memory}' | ps -o pid,%cpu,%mem,args -p $(pgrep -f lpdel)
PID %CPU %MEM COMMAND
142242 26.3 0.0 lpdel -rfn /20231225/
143313 33.5 0.0 lpdel -fn /20231225
有问题请加博主微信进行沟通!
全部评论