Skip to navigation
Check whether anything is listening on a port with unix
11.12.25
example port 15656 use the Socket Statistics tool ss ``` ss -ltnp | grep 15656 ``` Display All Sockets: ss -a or ss --all: Shows both listening and non-listening sockets [1][4]. Filter by Protocol: ss -t or ss --tcp: Displays only TCP sockets [1][2][4]. ss -u or ss --udp: Displays only UDP sockets [1][2][4]. ss -x or ss --unix: Displays Unix domain sockets [1][4]. ss -w or ss --raw: Displays RAW sockets [1][4]. Display Listening Sockets: ss -l or ss --listening: Shows only sockets in the listening state [1][2][4]. Display Established Connections: ss -t state established: Lists all established TCP connections [5]. Show Process Information: ss -p or ss --processes: Displays the process ID (PID) and process name associated with each socket [1][4][5]. This is crucial for identifying which application is using a particular connection [5]. ss -tp: Combines TCP sockets with process information [5]. Show Numerical Addresses and Ports: ss -n or ss --numeric: Prevents ss from trying to resolve service names, showing exact port numbers instead [1][6]. Show Timer Information: ss -o or ss --options: Displays timer information for sockets, useful for diagnosing connection issues [1][4]. Show Detailed Socket Information: ss -e or ss --extended: Provides extended details, such as user ID, inode number, and socket UUID [1][2][4]. Show Socket Memory Usage: ss -m or ss --memory: Displays memory usage statistics for sockets [1][5]. Display Summary Statistics: ss -s or ss --summary: Provides a summarized overview of socket types and their counts, which is more efficient than parsing large socket lists [1][2][4]. Filter by IP Version: ss -4 or ss --ipv4: Displays only IPv4 sockets [1][4]. ss -6 or ss --ipv6: Displays only IPv6 sockets [1][4]. Filter by State: ss -t state fin-wait-1: Filters TCP sockets by specific states like fin-wait-1 [1]. Other states include syn-sent, syn-recv, time-wait, closed, close-wait, last-ack, and closing [1]. Filter by Port or Address: ss dst :80: Filters connections where the destination port is 80 [2]. ss src 192.168.1.100: Filters connections where the source IP address is 192.168.1.100 [4]. ss -o state established '( dport = :ssh or sport = :ssh )': Displays established SSH connections [1].
https://man7.org/linux/man-pages/man8/ss.8.html
Reply
Anonymous
Information Epoch 1766751732
Use lower case and keep it short.
Home
Notebook
Contact us