diffs

Command output changes monitor


License
MIT
Install
pip install diffs==0.1.1

Documentation

diffs

GitHub version PyPI version

diffs monitors for any changes in arbitrary shell command output between the initial state and the current output.

Installation

pip3 install diffs

Python 3.6 (or newer) is required.

Usage

diffs CMD

The initial CMD output is stored at the beginning. Then the command is run again periodically and the output is compared against the initial output. If there are differences, they are shown in the standard diff format. The unchaged lines are not shown.

Examples

Show how many packets have been sent since the script has been started:
diffs ifconfig wlp2s0
diffs demo ifconfig

Find new applications opening network ports (shows only changes between the initial state):
diffs sudo netstat -tulpn
diffs demo netstat

Monitor changes in a file:

$ diffs cat /etc/resolv.conf

Difference between starting date and the current date:
diffs date
diffs demo date

Finding newly spawned processes:
diffs ps a -o pid,cmd
diffs demo ps