#!/bin/bash # 监控pm5g打开文件 while true; do sleep 1 date +'%Y-%m-%d %H:%M:%S' >>watch.log && lsof -p "$(pgrep -f pmInterface5g.jar)" | wc -l >>watch.log done &