tcpclient(1)
π NAME π
okay so weβre in the General Commands Manual and the main character is tcpclient(1) β she creates an outgoing TCP connection. thatβs the whole assignment, bestie. periodt. π
β¨ SYNOPSIS β¨
tcpclient [ opts ] host port prog
πΈ DESCRIPTION πΈ
okay so real talk: opts is a series of getopt-style options. host is one argument. port is one argument. prog consists of one or more arguments. got it? iconic. π«Ά
tcpclient attempts to connect to a TCP server. if it is successful, it runs prog, with descriptor 6 reading from the network and descriptor 7 writing to the network. it also sets up several environment variables β see tcp-environ(5). yes, sheβs setting the whole vibe up for you. β¨
the serverβs address is given by host and port. port may be a name from /etc/services or a number. host may be 0, referring to the local machine, or a dotted-decimal IP address, or a host name; it is fed through qualification using dns_ip4_qualify. slay.
if the server has several IP addresses, tcpclient tries each address in turn. sheβs thorough like that. π₯
π OPTIONS π
general options
-qβ Quiet. do not print error messages. shhh. π-Qβ (Default.) Print error messages. yes, she will tell you what went wrong. π-vβ Verbose. print error messages and status messages. sheβs giving commentary. π
connection options
-T x+yβ Give up on the connection attempt afterx+yseconds. Default:2+58. when a host has several IP addresses,tcpclienttries to connect to the first IP address, waitsxseconds, tries to connect to the second IP address, waitsxseconds, etc.; then it retries each address that timed out, waitingyseconds per address. you may omit+yto skip the second try. before version0.88,tcpclient(1)will use onlyx(default:60). okay so thatβs the timing tea. β³-i localipβ Uselocalipas the IP address for the local side of the connection; quit iflocalipis not available. normallytcpclientlets the operating system choose an address. sheβs usually chill like that. π¦-p localportβ Uselocalportas the TCP port for the local side of the connection; quit iflocalportis not available. normallytcpclientlets the operating system choose a port. same energy. π-dβ Delay sending data for a fraction of a second whenever the remote host is responding slowly. this is currently the default, but it may not be in the future; if you want it, set it explicitly. donβt just assume sheβll keep doing it, bestie. π«Ά-Dβ Never delay sending data; enableTCP_NODELAY. no waiting, no drama. π₯
data-gathering options
-hβ (Default.) Look up the remote host name in DNS to set the environment variable$TCPREMOTEHOST. sheβs nosy in a useful way. π-Hβ Do not look up the remote host name in DNS; remove the environment variable$TCPREMOTEHOST. bye-bye hostname lookup. π-l localnameβ Do not look up the local host name in DNS; uselocalnamefor the environment variable$TCPLOCALHOST. a common choice forlocalnameis0. noted. β-rβ (Default.) Attempt to obtain$TCPREMOTEINFOfrom the remote host. sheβs trying to get the info. π-Rβ Do not attempt to obtain$TCPREMOTEINFOfrom the remote host. no info-hunting today. π ββοΈ-t nβ Give up on the$TCPREMOTEINFOconnection attempt afternseconds. Default:26. clockβs ticking, bestie. β°
π¦ SEE ALSO π¦
tcpserver(1)tcprules(1)tcprulescheck(1)argv0(1)fixcrio(1)recordio(1)rblsmtpd(1)who@(1)date@(1)finger@(1)http@(1)tcpcat(1)mconnect(1)tcp-environ(5)
and the website moment:
http://cr.yp.to/ucspi-tcp.html
xoxo, signed sealed delivered: itβs tcpclient(1) in the footer, no extra source/version/date line to spill β thatβs the whole cute sign-off, bestie π«Άπ
π¦ where this page comes from
- debian bookworm: ucspi-tcp 1:0.88-7 Β· LicenseRef-public-domain
- debian trixie: ucspi-tcp 1:0.88-13 Β· LicenseRef-public-domain
- nixos 26.05: ucspi-tcp 0.88
- nixpkgs unstable: ucspi-tcp 0.88
- ubuntu jammy: ucspi-tcp 1:0.88-6 Β· LicenseRef-public-domain
- ubuntu noble: ucspi-tcp 1:0.88-8ubuntu1 Β· LicenseRef-public-domain
- ubuntu resolute: ucspi-tcp 1:0.88-13ubuntu1 Β· LicenseRef-public-domain
- ubuntu stonking: ucspi-tcp 1:0.88-13ubuntu1 Β· LicenseRef-public-domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms