首页/网络/协议速查/netstat 与 ss 对照
本包目录(405 条)
HTTP 方法与状态码91 条HTTP 头与缓存70 条DNS 与域名解析60 条
TCP 与 UDP54 条
TLS 与加密50 条IP 与 ICMP37 条邮件与文件传输43 条

netstat 与 ss 对照

老系统还在用 netstat,新系统推荐 ss:两者常用写法可互换,但 netstat 已从多数发行版默认包移除。

协议速查网络更新于 2026-10-12

需求

需求netstat 写法ss 写法
监听 TCPnetstat -lntpss -lntp
全部连接netstat -antss -ant
按端口过滤netstat -ant | grep :443ss -ant dport = :443
统计摘要netstat -sss -s + nstat
进程归属netstat -antpss -antp

安装与替代

安装与替代
ss -lntp
nstat -az | grep -E 'TcpRetrans|TcpExtListen'
容器镜像精简后常无 netstat;脚本里改用 ss 或读 /proc/net/* 更可靠。

易错点

  • netstat 在高并发下统计慢且可能丢样本;生产巡检优先 ss/nstat

数据来源与参考

  • man 8 ss
  • iproute2 文档

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌