Local daemons sometimes expose a Unix-domain socket instead of a TCP host and port, so a normal nc 127.0.0.1 9000 probe cannot reach them. Netcat can connect to the socket pathname directly when the installed implementation supports the -U option.
OpenBSD Netcat from netcat-openbsd on Ubuntu 26.04 accepts this command form. A one-shot listener creates /tmp/netcat-demo.sock, a client sends one test line to that pathname, and -N closes the client side after the piped input reaches end-of-file.
The command form uses a stream Unix socket. Add -u only when the target service documents a datagram socket, and avoid sending state-changing protocol messages to a production socket unless the service owner has confirmed the request is safe.
$ nc -h OpenBSD netcat (Debian patchlevel 1.234-1) usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-M ttl] ##### snipped ##### -U Use UNIX domain socket ##### snipped #####
If the help text does not show -U, install OpenBSD Netcat before continuing.
Related: How to install Netcat on Ubuntu
$ nc -lU /tmp/netcat-demo.sock
The listener creates /tmp/netcat-demo.sock and waits for one client connection. Leave this terminal open while sending the test line from another terminal.
$ ls -l /tmp/netcat-demo.sock srwxr-xr-x 1 root root 0 Jun 7 23:58 /tmp/netcat-demo.sock
The leading s in the file mode marks the path as a socket, not a regular file.
$ printf 'unix socket check\n' | nc -N -U /tmp/netcat-demo.sock
-N lets the listener finish after printf reaches end-of-file.
$ nc -lU /tmp/netcat-demo.sock unix socket check
The matching line confirms that Netcat reached the Unix-domain socket path.
$ rm -f /tmp/netcat-demo.sock
Do not remove a production service socket. Deleting its pathname can break local clients until the daemon recreates it.