tldr/pages/linux/ss.md

32 lines
514 B
Markdown
Raw Normal View History

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`
2014-02-27 12:51:25 +00:00
`ss -u src 127/8`
2014-02-27 12:51:25 +00:00
`ss -t 'dport >= :1024'`
2014-02-27 12:51:25 +00:00
`ss -x "src /tmp/.X11-unix/*"`
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}}`