4

what's the equivalent using ss command ?

netstat -antp
netstat -lntp

what's the difference if we use ss with no hyphen and with ss -a ? what does this command do for us ss -antlp ?

int_ua
  • 8,912
Ven Ven
  • 67
  • 1
    These questions seem easily answered on the manpage. Is there something on the manpage that you don't understand? – user535733 Mar 26 '20 at 03:51

2 Answers2

4

I've made a comparison table (in Google Docs) (light HTML link) for converting between netstat and ss arguments. It's too big to include and update it here.

google doc screenshot

The short version of difference between short arguments is:

Arguments that require attention: r N i g M W T v C F c A U 2 f

Arguments that are safe to leave as is: h V l a n Z s p e o 4 6 x t u S w

int_ua
  • 8,912
0

I stumbled across this post while researching netstat -> ss conversion. Outstanding table but I wanted to point out one thing in particular... the man page description for the netstat -s command option states, "Display summary statistics for each protocol". ss -s option in the man page states, "Print summary statistics. This option does not parse socket lists obtaining summary from various sources. It is useful when amount of sockets is so huge that parsing /proc/net/tcp is painful." These two command options return EXTIRELY different information.

For example:

$ ss -s
Total: 1365 (kernel 0)
TCP:   276 (estab 163, closed 14, orphaned 0, synrecv 0, timewait 1/0), ports 0

Transport Total IP IPv6

  •     0         -         -
    RAW 1 1 0 UDP 24 17 7 TCP 262 246 16 INET 287 264 23 FRAG 0 0 0

as opposed to the netstat -s command output (truncated):

$ netstat -s | head -n15
Ip:
  2043673568 total packets received
  0 forwarded
  0 incoming packets discarded
  1997519606 incoming packets delivered
  1359233819 requests sent out
  53 dropped because of missing route
  22 reassemblies required
  11 packets reassembled ok
Icmp:
  38023 ICMP messages received
  7619 input ICMP message failed.
  ICMP input histogram:
      destination unreachable: 23947
      timeout in transit: 129

I don't know if the upstream developers of ss intend on expanding the available output from the command, but near as I can tell... ss doesn't offer anything equivalent to the netstat -s statistics.

/ SenseiC bows out