Telnet Unix Socket – How to Telnet to a Unix Socket in Debian to Test Memcached

memcachedtelnetunix-sockets

To test memcached on Ubuntu, I would run this command:

echo "stats settings" | nc -U /run/mydir/memcached.sock

However now I have changed to Debian, and Debian nc does not support the -U option.

I have tried ss, listen, telnet -b /run/mydir/memcached.sock with no joy.

What is the equivalent command in Debian?

Best Answer

Install the ncat or the netcat-openbsd package, both provides a version of nc supporting -U.

If you don't have nc, you can connect to a unix socket with socat like this:

socat - UNIX-CONNECT:/the/path/to/the/socket