SOCKSTAT(1)
π SOCKSTAT(1) β bestie's guide to open sockets π
okay so, welcome to sockstat, a general commands manual page, and it's literally the tool you use to list open sockets. yes. that's the whole vibe. it's giving "who is holding a socket rn" and honestly? iconic. π
β¨ NAME β¨
sockstat β list open sockets π
πΈ SYNOPSIS πΈ
sockstat [-46clohu] [-p ports] [-P pid|process] [-U uid|user]
[-G gid|group] [-R protocol]
like, that's the whole shape of it, bestie. flags go in, sockets come out. π¦
π DESCRIPTION π
so the sockstat command lists open Internet or Unix domain sockets. that's it. that's the job. and it does it slayfully. β¨
the following options are available:
-4β show IPv4 sockets only. four only. no six allowed. π ββοΈ-6β show IPv6 sockets only. six only. four, you're not invited. π«-uβ also show unix sockets. yes, in addition. bonus sockets. π«Ά-cβ show connected sockets. the ones with a whole relationship. π-lβ show listening sockets. the ones just, like, waiting for someone to talk to them. π-oβ keep old behaviour by combining all filters with|instead of&. legacy mode fr fr, it's giving "back in my day". π-hβ show a usage summary. the little help moment. so helpful of it. π-pports β only show Internet sockets if either the local or foreign port number is on the specified list. the ports argument is a comma-separated list of port numbers and ranges specified as first and last port separated by a dash. so like1,2,3or1-3, yk? π-Ppid|process β only show sockets of the specified pid|process. the pid|process argument is a process name or a pid. either one, bestie, your choice. π-Uuid|user β only show sockets of the specified uid|user. the uid|user argument is a username or a uid. π-Ggid|group β only show sockets of the specified gid|group. the gid|group argument is a groupname or a gid. π§-Rprotocol β only show sockets of the specified protocol. the protocol argument is either'raw','tcp','udp'or'unix'. pick one, periodt. π₯
heads up bestie: if neither-cnor-lis specified,sockstatwill list both listening and connected sockets. so you get the whole roster. π
the information listed for each socket is:
- USER β the user who owns the socket. the main character, basically. π
- COMMAND β the command which holds the socket. who's holding it. caught in 4k. πΈ
- PID β the process ID of the command which holds the socket. its little ID number. π’
- FD β the file descriptor number of the socket. β¨
- PROTO β the transport protocol associated with the socket for Internet sockets, or the type of socket (
streamordatagram) for Unix sockets. π - LOCAL ADDRESS β for Internet sockets, this is the address the local end of the socket is bound to (see
getsockname(2)). for bound Unix sockets, it is the socket's filename. for other Unix sockets, it is a right arrow followed by the endpoint's filename, orβ??βif the endpoint could not be determined. so if you see??it's not being shady, it literally just couldn't figure it out. π - FOREIGN ADDRESS β (Internet sockets only) the address the foreign end of the socket is bound to (see
getpeername(2)). the other side of the situationship. π
π¦ SEE ALSO π¦
go read those too, bestie, they're part of the lore. π
β HISTORY β
the sockstat command appeared in FreeBSD 3.1. ancient. legendary. the blueprint. ποΈβ¨
π AUTHORS π
the sockstat command and this manual page were written by Dag-Erling SmΓΈrgrav <des@FreeBSD.org>.
the sockstat command was ported to Linux by William Pitcock <nenolod@nenolod.net>.
thank you for your service, kings. π«‘π
mwah π this was the Debian edition, dated May 18, 2008 β yeah it's an oldie but she still eats. go check your sockets, bestie, and stay iconic. πβ¨π¦
π¦ where this page comes from
- ubuntu resolute: sockstat 0.4.2-1 Β· BSD-3-Clause
- ubuntu stonking: sockstat 0.4.2-1 Β· BSD-3-Clause
- Copyright (c) 1999 Dag-Erling CoΓ―dan SmΓΈrgrav
- Copyright (c) 2018-2023 Thorsten Alteholz
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms