---
title: "awk code"
author: "standalone"
date: "2010-10-26T17:53:46Z"
tags: []
categories: ["编程语言"]
slug: "awk-code"
draft: false
lastmod: "2010-10-26T17:53:46Z"
id: 794779
url: "https://standalone.iteye.com/blog/794779"
---

```
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
```