summaryrefslogtreecommitdiff
path: root/content/posts/2019-2-24-walking-netstat-with-awk.md
diff options
context:
space:
mode:
authorChristian Segundo2024-09-01 20:34:09 +0200
committerChristian Segundo2024-09-01 20:34:09 +0200
commitfae17644b9ef2382994bf3ce7d288e08211c42ef (patch)
tree66305cadf6371bb777f8c2e7fa62db4930621e4c /content/posts/2019-2-24-walking-netstat-with-awk.md
parent82c70566e88d9260d68f69ab59e6761197d828ec (diff)
downloadcheck-caps-lock-fae17644b9ef2382994bf3ce7d288e08211c42ef.tar.gz
migrate more stuff
Diffstat (limited to 'content/posts/2019-2-24-walking-netstat-with-awk.md')
-rw-r--r--content/posts/2019-2-24-walking-netstat-with-awk.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/content/posts/2019-2-24-walking-netstat-with-awk.md b/content/posts/2019-2-24-walking-netstat-with-awk.md
new file mode 100644
index 0000000..1094bce
--- /dev/null
+++ b/content/posts/2019-2-24-walking-netstat-with-awk.md
@@ -0,0 +1,18 @@
+---
+layout: post
+title: Walking /proc/net/netstat like a pro with awk
+category: GNU/Linux
+tags:
+ - networking
+---
+
+Little snippet to parse `/proc/net/netstat` and format the output:
+
+```bash
+awk '{for(i=1;i<=NF;i++)title[i] = $i; getline; print title[1]; for(i=2;i<=NF;i++)printf " %s: %s\n", title[i], $i }' /proc/net/netstat
+
+TcpExt:
+ ...
+IpExt:
+ ...
+```