getpeername(1)

getpeername1

Get name of connected tcp/ip peer

Usage

getpeername [-n] [-p protocol]

Overview

getpeername prints the IP address and service name (port number) of the remote peer connected to standard input. The IP address and the service name are printed on the same line, separated by one space.

Options

-n

Don't translate IP addresses and port numbers to names.

-p protocol

Force getpeername to use protocol as the protocol when translating port numbers to service names. Protocol can be tcp and udp. Normally, getpeername automatically determines what type of socket it is connected to.

Releases

Unchanged in 14 releases since Debian 2.1 (Slink).

  1. 2.1–13

Bugs

Only works on IP sockets.

From tcputils 0.6.2+git20120127.c28952d-0.1 in Debian 13 (Trixie). Parsed by carta from the page's man source.