查看客户占用内存

  |   0 评论   |   57 浏览

#!/bin/bash

stats=””
echo "%   user"
echo "============"

# collect the data
for user in `ps aux | grep -v COMMAND | awk '{print $1}' | sort -u`
do
  stats="$stats\n`ps aux | egrep ^$user | awk 'BEGIN{total=0}; \
    {total += $4};END{print total,$1}'`"
done

# sort data numerically (largest first)
echo -e $stats | grep -v ^$ | sort -rn | head


标题:查看客户占用内存
作者:lishulongVI
地址:https://blog.thinking.mobi/articles/2020/09/22/1600742064033.html

评论

发表评论