2014-02-26 16:51:09 +00:00
|
|
|
# ss
|
|
|
|
|
|
|
|
> Utility to investigate sockets
|
|
|
|
|
|
|
|
- Dump all TCP/UDP/RAW/UNIX sockets
|
|
|
|
|
|
|
|
`ss -a {{-t/-u/-w/-x}}`
|
|
|
|
|
2014-02-27 12:51:25 +00:00
|
|
|
- Show process(es) that using socket
|
|
|
|
|
|
|
|
`ss -p`
|
|
|
|
|
2014-02-26 16:51:09 +00:00
|
|
|
- Filter TCP sockets by states, only/exclude
|
|
|
|
|
|
|
|
`ss {{state/exclude}} {{bucket/big/connected/synchronized/...}}`
|
|
|
|
|
|
|
|
- Filter sockets by address and/or port
|
|
|
|
|
2014-02-27 12:51:25 +00:00
|
|
|
`ss -t dst 1.2.3.4:80`
|
2015-10-28 17:10:44 +00:00
|
|
|
|
2014-02-27 12:51:25 +00:00
|
|
|
`ss -u src 127/8`
|
2015-10-28 17:10:44 +00:00
|
|
|
|
2014-02-27 12:51:25 +00:00
|
|
|
`ss -t 'dport >= :1024'`
|
2015-10-28 17:10:44 +00:00
|
|
|
|
2014-02-27 12:51:25 +00:00
|
|
|
`ss -x "src /tmp/.X11-unix/*"`
|
2015-10-28 17:10:44 +00:00
|
|
|
|
2014-02-27 12:51:25 +00:00
|
|
|
`ss -t state established '( dport = :ssh or sport = :ssh )'`
|
2014-02-26 16:51:09 +00:00
|
|
|
|
|
|
|
- Only list IPv4 or IPv6 sockets
|
|
|
|
|
|
|
|
`ss {{-4/-6}}`
|