tldr/pages/linux/ss.md

28 lines
633 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
2016-01-24 15:45:44 +00:00
- Show all TCP/UDP/RAW/UNIX sockets:
2014-02-26 16:51:09 +00:00
`ss -a {{-t/-u/-w/-x}}`
- Filter TCP sockets by states, only/exclude:
2014-02-26 16:51:09 +00:00
`ss {{state/exclude}} {{bucket/big/connected/synchronized/...}}`
2016-01-24 15:45:44 +00:00
- Show all TCP sockets connected to the local HTTPS port:
`ss -t src :{{443}}`
- Show all TCP sockets along with processes connected to a remote ssh port:
`ss -pt dst :{{ssh}}`
- Show all UDP sockets connected on a local port within a range:
2014-02-26 16:51:09 +00:00
2016-01-24 15:45:44 +00:00
`ss -u 'sport >= :{{lowest_port}} and sport <= :{{highest_port}}'`
2014-02-26 16:51:09 +00:00
2016-01-24 15:45:44 +00:00
- Show all TCP IPv4 sockets locally connected on the subnet 192.168.0.0/16:
2014-02-26 16:51:09 +00:00
2016-01-24 15:45:44 +00:00
`ss -4t {{192.168/16}}`