Skip to content

Instantly share code, notes, and snippets.

@mike-zhang
Created November 9, 2012 08:49
Show Gist options
  • Save mike-zhang/4044537 to your computer and use it in GitHub Desktop.
Save mike-zhang/4044537 to your computer and use it in GitHub Desktop.
定时显示与特定主机的连接
#! /bin/bash
r_host='10.11.1.100'
if [ -f '/usr/bin/watch' ]
then
watch -n 1 -d "netstat -an | grep $r_host"
else
while [ 1 ]
do
netstat -an | grep $r_host
sleep 1
clear
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment