Quantcast
Channel: Is there a paging version of `watch`? - Server Fault
Viewing all articles
Browse latest Browse all 14

Answer by Jacques Lemieux for Is there a paging version of `watch`?

$
0
0

In case this could be useful to others, this is how I solved the issue on my side. In the "cmd" function, plug any command you want to monitor.

#!/bin/bashfunction cmd {  sudo lsof -i -n -P | grep 11.12.13.14:8883 }echo "" >previous.logwhile true; do   cmd >out.log    diff out.log previous.log >/dev/null   cc="$?"  if [[ "$cc" != "0" ]]; then    date=`date --rfc-3339=seconds`    epoch=`date +%s`    echo ""    echo "Changes on $date ($epoch)"     cat out.log    cp out.log previous.log  fi  sleep 0.5done    

Viewing all articles
Browse latest Browse all 14

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>