Netstat output line width limit

As explained in this response to a similar question regarding aptitude and dpkg, netstat is truncating the output because when it's piped to grep, it doesn't know how wide the output should be. Solutions to this general problem depend specifically on the options to the program that's being fed into the pipe. In the case of netstat, the only choice I see is to use the --wide option, which tells it to assume the output is as wide as needed for the output. You might then want to use cut -c-100 eg. if you really only want 100 characters per line.


This is something that may have been fixed by now. I was having the same problem trying see what ports were listening.

I was running netstat -vat. This resulted in truncated columns. I found that just by adding a capitol "T" to the end, it'll give me what I want.

netstat -vatT

v = verbose a = all t = tcp T = notrim (stop trimming long addresses)