Skip to content

Instantly share code, notes, and snippets.

@danrl
Created June 20, 2013 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danrl/5821679 to your computer and use it in GitHub Desktop.
Save danrl/5821679 to your computer and use it in GitHub Desktop.
Proposed multi-line output for netstat.
Proposed multi-line output for netstat
======================================
Current Layout
--------------
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp6 0 0 2001:67c:26f4:64::55736 2001:67c:26f4:64::7:993 ESTABLISHED
Note: The current layout seems to cut off addresses.
Proposal #1 (RFC-compliant, one line, 80+ chars)
------------------------------------------------
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp6 0 0 [2001:67c:26f4:64:1234:5789:abcd:abcd]:55736 [2001:67c:26f4:64:1234:5678:abcd:ab70]:993 ESTABLISHED
Note: It breaks layout even if we only use low-byte interface identifier.
80+ chars still.
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp6 0 0 [2001:67c:26f4:64::79]:55736 [2001:67c:26f4:64::70]:993 ESTABLISHED
Proposal #2 (RFC-compliant, multi-line, <80 chars)
--------------------------------------------------
Proto Recv-Q Send-Q State
tcp6 0 0 ESTABLISHED
Local Address [2001:67c:26f4:64:1234:5678:abcd:abcd]:55736
Foreign Address [2001:67c:26f4:64:1234:5678:abcd:ab70]:993
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment