From 845668414fe12b23123564e31cf13f7ada765ac8 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Thu, 27 Feb 2014 00:51:09 +0800 Subject: [PATCH 1/2] add ss.md --- linux/ss.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 linux/ss.md diff --git a/linux/ss.md b/linux/ss.md new file mode 100644 index 0000000000..9000f4fb11 --- /dev/null +++ b/linux/ss.md @@ -0,0 +1,19 @@ +# ss + +> Utility to investigate sockets + +- Dump all TCP/UDP/RAW/UNIX sockets + +`ss -a {{-t/-u/-w/-x}}` + +- Filter TCP sockets by states, only/exclude + +`ss {{state/exclude}} {{bucket/big/connected/synchronized/...}}` + +- Filter sockets by address and/or port + +`ss {{dst/src/dport/sport}} {{==/!=/>/ Date: Thu, 27 Feb 2014 20:51:25 +0800 Subject: [PATCH 2/2] ss: refine examples --- linux/ss.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/linux/ss.md b/linux/ss.md index 9000f4fb11..6643f75912 100644 --- a/linux/ss.md +++ b/linux/ss.md @@ -6,13 +6,21 @@ `ss -a {{-t/-u/-w/-x}}` +- Show process(es) that using socket + +`ss -p` + - Filter TCP sockets by states, only/exclude `ss {{state/exclude}} {{bucket/big/connected/synchronized/...}}` - Filter sockets by address and/or port -`ss {{dst/src/dport/sport}} {{==/!=/>/= :1024'` +`ss -x "src /tmp/.X11-unix/*"` +`ss -t state established '( dport = :ssh or sport = :ssh )'` - Only list IPv4 or IPv6 sockets