I want to read only the first line of netstat, i.e. the line that explains what each column means:
Proto Local Address Foreign Address State
However, when I do the following:
netstat | egrep -i "^\s*(tcp|udp)" | {
read line
echo 'Here is the first line ' $line
}
I only get the first line of connections:
Here is the first line TCP <Local_addr> <Foreign_addre> ESTABLISHED
How do I get just that one line?
I am runing Cygwin on Windows 7 machine. Thanks.