[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Netstat script?



On Sun, 20 Feb 2005, SigmaX wrote:

> I know nothing about scripting, but I want to write/obtain a script that 
> displays the results of the command "netstat -a | grep tcp", then clears 
> the screen and does so again a few seconds later.  Else I just need a 
> program that does something similar in the console, so I can view it 
> over SSH.

A very simple one for this

#!/bin/bash

while [ 1 ] ; do

   netstat -a | grep tcp
   sleep 1 # This is number of seconds
   clear

done

That should do what you want on a very basic level

Rus
-- 
e: rghf@vpscolo.com : t: 1-888-327-6330       
http://www.vaserv.com - Coming soon. Email sales@vaserv.com for more info
http://www.storemypic.com - Free Image Hosting
http://www.vpsforums.com - Talk for VPS users and Providers
http://www.jvds.com - VPS Hosting for the geeks



Reply to: