tldr/pages/linux/ss.md

28 lines
516 B
Markdown
Raw Normal View History

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