Sample Header Ad - 728x90

Netstat output line width limit

20 votes
4 answers
15959 views
When executing netstat, I find that the command's output width is limited regardless of the console size, in contrast with other commands such as ps that seem to get adjusted. So for example: $ sudo netstat -natp | grep sshd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1454/sshd tcp 0 48 xx.xx.xx.xx:22 xx.xx.xx.xx:44182 ESTABLISHED 1147/sshd: wtower [ tcp6 0 0 :::22 :::* LISTEN 1454/sshd You can notice that the line width of the second output is short (ends at [). Is there any way so I get the proper output from netstat? *UPDATE*: The package version is net-tools_1.60-24.1ubuntu2_i386 running on Ubuntu Server 12.04.5 LTS. Unfortunately redirecting to file produces the same output. At any console size the output is the above. At smaller sizes it just wraps each line, but *still* the output is the same, shortened.
Asked by Wtower (405 rep)
Jun 25, 2015, 11:07 AM
Last activity: Mar 14, 2024, 09:08 AM