SOCKSTAT(1)

πŸ“¦
version 0.4.2 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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. πŸ™ˆ
  • -p ports β€” 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 like 1,2,3 or 1-3, yk? πŸ“
  • -P pid|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. πŸ‘‘
  • -U uid|user β€” only show sockets of the specified uid|user. the uid|user argument is a username or a uid. πŸŽ€
  • -G gid|group β€” only show sockets of the specified gid|group. the gid|group argument is a groupname or a gid. 🧚
  • -R protocol β€” 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 -c nor -l is specified, sockstat will 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 (stream or datagram) 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 πŸ¦‹

netstat(1), protocols(5)

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