1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-06 22:46:02 +02:00
tldr/pages/linux/ss.md

37 lines
1 KiB
Markdown
Raw Normal View History

2014-02-27 00:51:09 +08:00
# ss
> Utility to investigate sockets.
2021-04-07 02:14:32 +02:00
> More information: <https://manned.org/ss.8>.
2014-02-27 00:51:09 +08:00
2016-01-24 16:45:44 +01:00
- Show all TCP/UDP/RAW/UNIX sockets:
2014-02-27 00:51:09 +08:00
`ss {{[-a|--all]}} {{-t|-u|-w|-x}}`
2014-02-27 00:51:09 +08:00
- Filter TCP sockets by states, only/exclude:
2014-02-27 00:51:09 +08:00
`ss {{state|exclude}} {{bucket|big|connected|synchronized|...}}`
2014-02-27 00:51:09 +08:00
- Show all TCP sockets connected to the local HTTPS port (443):
2016-01-24 16:45:44 +01:00
`ss {{[-t|--tcp]}} src :{{443}}`
2016-01-24 16:45:44 +01:00
- Show all TCP sockets listening on the local 8080 port:
`ss {{[-lt|--listening --tcp]}} src :{{8080}}`
- Show all TCP sockets along with processes connected to a remote SSH port:
2016-01-24 16:45:44 +01:00
`ss {{[-pt|--processes --tcp]}} dst :{{ssh}}`
2016-01-24 16:45:44 +01:00
- Show all UDP sockets connected on specific source and destination ports:
2014-02-27 00:51:09 +08:00
`ss {{[-u|--udp]}} 'sport == :{{source_port}} and dport == :{{destination_port}}'`
2014-02-27 00:51:09 +08:00
2016-01-24 16:45:44 +01:00
- Show all TCP IPv4 sockets locally connected on the subnet 192.168.0.0/16:
2014-02-27 00:51:09 +08:00
`ss {{[-4t|--ipv4 --tcp]}} src {{192.168/16}}`
- Kill IPv4 or IPv6 Socket Connection with destination IP 192.168.1.17 and destination port 8080:
`ss {{[-K|--kill]}} dst {{192.168.1.17}} dport = {{8080}}`