Quantcast
Viewing latest article 1
Browse Latest Browse All 14

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

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 latest article 1
Browse Latest Browse All 14

Trending Articles



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