Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sockstat(1) [freebsd man page]

SOCKSTAT(1)						    BSD General Commands Manual 					       SOCKSTAT(1)

sockstat -- list open sockets SYNOPSIS
sockstat [-46cLlu] [-j jid] [-p ports] [-P protocols] DESCRIPTION
The sockstat command lists open Internet or UNIX domain sockets. The following options are available: -4 Show AF_INET (IPv4) sockets. -6 Show AF_INET6 (IPv6) sockets. -c Show connected sockets. -j jid Show only sockets belonging to the specified jail ID. -L Only show Internet sockets if the local or foreign addresses are not in the loopback network prefix, or do not con- tain the IPv6 loopback address ::1. -l Show listening sockets. -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. -P protocols Only show sockets of the specified protocols. The protocols argument is a comma-separated list of protocol names, as they are defined in protocols(5). -u Show AF_LOCAL (UNIX) sockets. If neither -4, -6 or -u is specified, sockstat will list sockets in all three domains. If neither -c or -l is specified, sockstat will list both listening and connected sockets. The information listed for each socket is: USER The user who owns the socket. COMMAND The command which holds the socket. PID The process ID of the command which holds the socket. 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. FOREIGN ADDRESS (Internet sockets only) The address the foreign end of the socket is bound to (see getpeername(2)). If a socket is associated with more than one file descriptor, it is shown multiple times. If a socket is not associated with any file descriptor, the first four columns have no meaning. SEE ALSO
fstat(1), netstat(1), procstat(1), inet(4), inet6(4), protocols(5) HISTORY
The sockstat command appeared in FreeBSD 3.1. AUTHORS
The sockstat command and this manual page were written by Dag-Erling Smorgrav <>. BSD
May 16, 2012 BSD

Check Out this Related Man Page

udp(7)							 Miscellaneous Information Manual						    udp(7)

udp - Internet user datagram protocol (UDP) SYNOPSIS
#include <sys/socket.h> #include <netinet/in.h> The following is the socket call for AF_INET sockets: s = socket(AF_INET, SOCK_DGRAM, 0); The following is the socket call for AF_INET6 sockets: s = socket(AF_INET6, SOCK_DGRAM, 0); DESCRIPTION
UDP is a simple, unreliable datagram protocol that is used to support the SOCK_DGRAM abstraction for the Internet Protocol family. UDP sockets are connectionless, and are normally used with the sendto() and recvfrom() functions, though the connect() function may also be used to fix the destination for future packets, in which case the recv() or read() and send() or write() functions may be used. UDP address formats are identical to those used by TCP. In particular, UDP provides a port identifier in addition to the normal Internet address format. Note that the UDP port space is separate from the TCP port space (that is, a UDP port may not be "connected" to a TCP port). In addition, IPv4 broadcast packets may be sent (assuming the underlying network supports this) by using a reserved "broadcast address"; this address is network interface dependent. There is no broadcast address in IPv6. Options at the IP transport level may be used with UDP; see the ip() reference page. ERRORS
If a socket operation fails, errno may be set to one of the following values: An attempt was made to create a socket with a port that has already been allocated. An attempt was made to create a socket with a network address for which no network interface exists. The socket is already connected. This error occurs when trying to establish connection on a socket or when trying to send a datagram with the desti- nation address specified. The system ran out of memory for an internal data structure. The destination address of a datagram was not specified, and the socket has not been connected. RELATED INFORMATION
Functions: getsockopt(2), recv(2), send(2), socket(2) Files: netintro(7), inet(7), ip(7) delim off udp(7)
Man Page

Featured Tech Videos