shell监控linux系统进程创建脚本分享_linuxshell教程-查字典教程网
shell监控linux系统进程创建脚本分享
shell监控linux系统进程创建脚本分享
发布时间:2016-12-28 来源:查字典编辑
摘要:复制代码代码如下:#!/bin/shwhiletruedopsax-ocommand|sort|uniq>1.txtusleep100000...

复制代码 代码如下:

#!/bin/sh

while true

do

ps ax -o command | sort | uniq > 1.txt

usleep 100000

ps ax -o command | sort | uniq > 2.txt

diff 1.txt 2.txt | grep '^+[^+]' | while read a

do

a=`echo ${a#*+}`

if [[ "$a" != "uniq" ]] && [[ "$a" != "sort" ]] && [[ "$a" != "" ]]

then

echo $a

fi

done

done

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新linuxshell学习
    热门linuxshell学习
    脚本专栏子分类