脚本之家,脚本语言编程技术及教程分享平台!
分类导航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|shell|

服务器之家 - 脚本之家 - shell - shell监控linux系统进程创建脚本分享

shell监控linux系统进程创建脚本分享

2022-12-25 14:59shell教程网 shell

shell监控linux系统进程创建脚本,大家参考使用吧

复制代码 代码如下:

#!/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

 

延伸 · 阅读

精彩推荐