Linux scripting is a skill every network/system engineer should learn in the early stages of the career. Plenty of guides available in the interwebz, The Bash Academy is a good start.
A particular type of scripts are the one-liners: just a line of code to solve a problem.
This is the latest I’ve used while testing autossh, check active ssh sessions continuously:
while true; do netstat -an | egrep -e ':22 '; sleep 2s;clear;done
Enjoy!comments powered by Disqus