linux 性能查看命令

来源:互联网 发布:冰川网络 郑州 编辑:程序博客网 时间:2024/05/19 19:40

top

lsof

/proc/*/fd

 

 

 

#!/bin/bash

time=`date +%Y%m%d%H%M%S`
file1=$1.$time
file2=$2.$time
if [[ -f $file1 ]]
then
        head="boom boom boom"   
else
        touch $file1
fi
if [[ -f $file2 ]]
then
        head="boom boom boom"   
else
        touch $file2
fi
top -b -n 1 >> $file1
pids=`ps ax | grep resin | grep java | awk -F' ' '{print $1}'`
for i in $pids
do
        ls -all /proc/$i/fd/ >> $file2
done
exit 0

原创粉丝点击