Displaying a field completely

Version: AIX 6.1 (korn shell)

In the below output, the field with the heading 'Address' has some names like

hwproc214-priv1.gnas.wrd.net

which are only partially displayed.

$ netstat -i
Name  Mtu   Network     Address           Ipkts Ierrs    Opkts Oerrs  Coll
en2   1500  link#2      ba.f0.10.7e.23.12  2850803     0  1917922     0     0
en2   1500  172.20.207  hwproc214-priv1.  2850803     0  1917922     0     0
en2   1500  169.254     169.254.115.157   2850803     0  1917922     0     0
en5   1500  link#3      hwproc218-priv1.  2851261     0  1917876     0     0
.
.
.

To displayed the 'Adress' field (the fourth one) , i tried

$ netstat -i| cut -d: -f4

But it just gave the same output as above. I want the 'Adress' field (fourth one) to be displayed completely. How can I do this?

Have you tried:

netstat -i | awk '{print $4}'

Start with:

netstat -in | awk '{print $4}' | grep -v "Address"

Then look up the full name of those which are IP addresses (not MAC addresses) in /etc/hosts or DNS according to where netstat finds the name on your computer.

1 Like

Try this one..

 awk '{print $4}' test1.txt